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
3f0f7fa3
Commit
3f0f7fa3
authored
Nov 25, 2013
by
Greg Price
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1752 from edx/gprice/inline-discussion-error-recovery
Add error recovery to inline discussion loading
parents
7a56e00d
7e074f1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
CHANGELOG.rst
+3
-0
common/static/coffee/src/discussion/discussion_module_view.coffee
+28
-7
No files found.
CHANGELOG.rst
View file @
3f0f7fa3
...
...
@@ -12,6 +12,9 @@ Blades: Update the calculator hints tooltip with full information. BLD-400.
Blades: Fix transcripts 500 error in studio (BLD-530)
LMS: Add error recovery when a user loads or switches pages in an
inline discussion.
Blades: Allow multiple strings as the correct answer to a string response question. BLD-474.
Blades: a11y - Videos will alert screenreaders when the video is over.
...
...
common/static/coffee/src/discussion/discussion_module_view.coffee
View file @
3f0f7fa3
...
...
@@ -36,12 +36,15 @@ if Backbone?
event
.
preventDefault
()
@
newPostForm
.
slideUp
(
300
)
hideDiscussion
:
->
@
$
(
"section.discussion"
).
slideUp
()
@
toggleDiscussionBtn
.
removeClass
(
'shown'
)
@
toggleDiscussionBtn
.
find
(
'.button-text'
).
html
(
"Show Discussion"
)
@
showed
=
false
toggleDiscussion
:
(
event
)
->
if
@
showed
@
$
(
"section.discussion"
).
slideUp
()
@
toggleDiscussionBtn
.
removeClass
(
'shown'
)
@
toggleDiscussionBtn
.
find
(
'.button-text'
).
html
(
"Show Discussion"
)
@
showed
=
false
@
hideDiscussion
()
else
@
toggleDiscussionBtn
.
addClass
(
'shown'
)
@
toggleDiscussionBtn
.
find
(
'.button-text'
).
html
(
"Hide Discussion"
)
...
...
@@ -51,9 +54,17 @@ if Backbone?
@
showed
=
true
else
$elem
=
@
toggleDiscussionBtn
@
loadPage
$elem
@
loadPage
(
$elem
,
=>
@
hideDiscussion
()
DiscussionUtil
.
discussionAlert
(
"Sorry"
,
"We had some trouble loading the discussion. Please try again."
)
)
loadPage
:
(
$elem
)
=>
loadPage
:
(
$elem
,
error
)
=>
discussionId
=
@
$el
.
data
(
"discussion-id"
)
url
=
DiscussionUtil
.
urlFor
(
'retrieve_discussion'
,
discussionId
)
+
"?page=
#{
@
page
}
"
DiscussionUtil
.
safeAjax
...
...
@@ -63,6 +74,7 @@ if Backbone?
type
:
"GET"
dataType
:
'json'
success
:
(
response
,
textStatus
,
jqXHR
)
=>
@
renderDiscussion
(
$elem
,
response
,
textStatus
,
discussionId
)
error
:
error
renderDiscussion
:
(
$elem
,
response
,
textStatus
,
discussionId
)
=>
window
.
user
=
new
DiscussionUser
(
response
.
user_info
)
...
...
@@ -131,5 +143,14 @@ if Backbone?
navigateToPage
:
(
event
)
=>
event
.
preventDefault
()
window
.
history
.
pushState
({},
window
.
document
.
title
,
event
.
target
.
href
)
currPage
=
@
page
@
page
=
$
(
event
.
target
).
data
(
'page-number'
)
@
loadPage
(
$
(
event
.
target
))
@
loadPage
(
$
(
event
.
target
),
=>
@
page
=
currPage
DiscussionUtil
.
discussionAlert
(
"Sorry"
,
"We had some trouble loading the threads you requested. Please try again."
)
)
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