Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-drag-and-drop-v2
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
OpenEdx
xblock-drag-and-drop-v2
Commits
3b31be05
Commit
3b31be05
authored
Jan 13, 2016
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix JS handling of feedback popups.
parent
7a1ddad9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
18 deletions
+21
-18
drag_and_drop_v2/public/js/drag_and_drop.js
+21
-18
No files found.
drag_and_drop_v2/public/js/drag_and_drop.js
View file @
3b31be05
...
...
@@ -160,28 +160,23 @@ function DragAndDropBlock(runtime, element, configuration) {
* Update the DOM to reflect 'state'.
*/
var
applyState
=
function
()
{
// Is there a change to the feedback popup?
if
(
state
.
feedback
!==
previousFeedback
)
{
if
(
state
.
feedback
)
{
if
(
previousFeedback
)
{
publishEvent
({
event_type
:
'xblock.drag-and-drop-v2.feedback.closed'
,
content
:
previousFeedback
,
manually
:
false
,
});
}
publishEvent
({
event_type
:
'xblock.drag-and-drop-v2.feedback.opened'
,
content
:
state
.
feedback
,
});
}
else
{
// Has the feedback popup been closed?
if
(
state
.
closing
)
{
if
(
previousFeedback
)
{
publishEvent
({
event_type
:
'xblock.drag-and-drop-v2.feedback.closed'
,
content
:
state
.
f
eedback
,
manually
:
true
,
content
:
previousF
eedback
,
manually
:
state
.
manually_closed
,
});
previousFeedback
=
undefined
;
}
previousFeedback
=
state
.
feedback
;
}
// Has feedback been set?
if
(
state
.
feedback
)
{
publishEvent
({
event_type
:
'xblock.drag-and-drop-v2.feedback.opened'
,
content
:
state
.
feedback
,
});
}
updateDOM
();
...
...
@@ -471,6 +466,14 @@ function DragAndDropBlock(runtime, element, configuration) {
return
;
}
state
.
closing
=
true
;
if
(
target
.
is
(
close_button
))
{
state
.
manually_closed
=
true
;
previousFeedback
=
state
.
feedback
;
}
else
{
state
.
manually_closed
=
false
;
}
delete
state
.
feedback
;
applyState
();
};
...
...
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