Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
cb4e2df9
Commit
cb4e2df9
authored
May 19, 2015
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #448 from open-craft/forum-thread-hotfix
Load thread if requested thread isn't loaded yet.
parents
eab46955
e11c818a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
common/static/coffee/src/discussion/discussion_router.coffee
+18
-0
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
+0
-6
No files found.
common/static/coffee/src/discussion/discussion_router.coffee
View file @
cb4e2df9
...
@@ -107,3 +107,21 @@ if Backbone?
...
@@ -107,3 +107,21 @@ if Backbone?
complete
:
=>
complete
:
=>
$
(
'.forum-content'
).
fadeIn
(
200
)
$
(
'.forum-content'
).
fadeIn
(
200
)
)
)
retrieveSingleThread
:
(
forum_name
,
thread_id
,
callback
)
->
DiscussionUtil
.
safeAjax
url
:
DiscussionUtil
.
urlFor
(
'retrieve_single_thread'
,
forum_name
,
thread_id
)
success
:
(
data
,
textStatus
,
xhr
)
=>
callback
(
new
Thread
(
data
[
'content'
]))
error
:
(
xhr
)
=>
if
xhr
.
status
==
404
DiscussionUtil
.
discussionAlert
(
gettext
(
"Sorry"
),
gettext
(
"The thread you selected has been deleted. Please select another thread."
)
)
else
DiscussionUtil
.
discussionAlert
(
gettext
(
"Sorry"
),
gettext
(
"We had some trouble loading more responses. Please try again."
)
)
@
allThreads
()
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
cb4e2df9
...
@@ -22,12 +22,6 @@ if Backbone?
...
@@ -22,12 +22,6 @@ if Backbone?
if
@
mode
not
in
[
"tab"
,
"inline"
]
if
@
mode
not
in
[
"tab"
,
"inline"
]
throw
new
Error
(
"invalid mode: "
+
@
mode
)
throw
new
Error
(
"invalid mode: "
+
@
mode
)
# Quick fix to have an actual model when we're receiving new models from
# the server.
@
model
.
collection
.
on
"reset"
,
(
collection
)
=>
id
=
@
model
.
get
(
"id"
)
@
model
=
collection
.
get
(
id
)
if
collection
.
get
(
id
)
@
createShowView
()
@
createShowView
()
@
responses
=
new
Comments
()
@
responses
=
new
Comments
()
@
loadedResponses
=
false
@
loadedResponses
=
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment