Commit 143e0329 by dragonfi

Publish close and open event instead of replace

parent 110c3e85
...@@ -96,7 +96,8 @@ function DragAndDropBlock(runtime, element) { ...@@ -96,7 +96,8 @@ function DragAndDropBlock(runtime, element) {
_fn.$popup.hide(); _fn.$popup.hide();
publish_event({ publish_event({
event_type: 'xblock.drag-and-drop-v2.feedback.closed', event_type: 'xblock.drag-and-drop-v2.feedback.closed',
content: _fn.$popup.find(".popup-content").text() content: _fn.$popup.find(".popup-content").text(),
manually: true
}); });
}); });
}, },
...@@ -239,16 +240,15 @@ function DragAndDropBlock(runtime, element) { ...@@ -239,16 +240,15 @@ function DragAndDropBlock(runtime, element) {
if (_fn.$popup.is(":visible")) { if (_fn.$popup.is(":visible")) {
publish_event({ publish_event({
event_type: "xblock.drag-and-drop-v2.feedback.replaced", event_type: "xblock.drag-and-drop-v2.feedback.closed",
old: _fn.$popup.find(".popup-content").text(), content: _fn.$popup.find(".popup-content").text(),
new: str manually: false
}); });
} else { };
publish_event({ publish_event({
event_type: "xblock.drag-and-drop-v2.feedback.opened", event_type: "xblock.drag-and-drop-v2.feedback.opened",
content: str content: str
}); });
}
_fn.$popup.find(".popup-content").text(str); _fn.$popup.find(".popup-content").text(str);
return _fn.$popup.show(); return _fn.$popup.show();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment