From 248bc3fefa3eed44a6ffed7374bea9310962fb88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 7 Aug 2014 16:44:44 +0200 Subject: [PATCH] edtior: fix exercise.order document events handling --- src/editor/plugins/core/edumed/order/element.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/editor/plugins/core/edumed/order/element.js b/src/editor/plugins/core/edumed/order/element.js index a81155e..724f2ec 100644 --- a/src/editor/plugins/core/edumed/order/element.js +++ b/src/editor/plugins/core/edumed/order/element.js @@ -57,7 +57,7 @@ _.extend(OrderExerciceElement, { this.createContainer(this.wlxmlNode.object.getDescription(), { resetBackground: true, manages: function(node, removedFrom) { - if(node.is('list.orderable')) { + if(node.is('list.orderable') || (removedFrom && removedFrom.is('list.orderable'))) { return false; } return exerciseNode.sameNode(node.parent() || removedFrom); //!n.hasFollowingSibing(this.params.listnode); @@ -79,6 +79,12 @@ _.extend(OrderExerciceElement, { this.reloadView(); } }, + onNodeDetached: function(event) { + var node = event.meta.node; + if(node.is('item.answer') && event.meta.parent && event.meta.parent.is('list.orderable')) { + this.reloadView(); + } + }, reloadView: function() { this.view.clearItems(); this.wlxmlNode.object.getItems().forEach(function(item) { -- 2.20.1