Skip to content
Snippets Groups Projects
Commit 3573b101 authored by Marco Gandi's avatar Marco Gandi Committed by Mingsong Hu
Browse files

Issue #3191599 by elgandoz: Modal not opening after search/drag-and-drop

parent 0869891a
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
}; };
let options; let options;
var offset = 0; var offset = 0;
if (optionsJson) { if (optionsJson) {
options = JSON.parse(optionsJson); options = JSON.parse(optionsJson);
if (options.theme) { if (options.theme) {
...@@ -58,12 +58,12 @@ ...@@ -58,12 +58,12 @@
}, },
plugins: ["search", "dnd"] plugins: ["search", "dnd"]
}); });
// Node move event. // Node move event.
treeContainer.on("move_node.jstree", function(event, data) { treeContainer.on("move_node.jstree", function(event, data) {
const thisTree = data.instance; const thisTree = data.instance;
const movedNode = data.node; const movedNode = data.node;
if (!rollback) { if (!rollback) {
let list = thisTree.get_node(data.parent).children; let list = thisTree.get_node(data.parent).children;
let before = ''; let before = '';
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
if (data.position > 0) { if (data.position > 0) {
before = list[data.position - 1]; before = list[data.position - 1];
} }
if (data.position < list.length - 1) { if (data.position < list.length - 1) {
after = list[data.position + 1]; after = list[data.position + 1];
} }
...@@ -96,18 +96,14 @@ ...@@ -96,18 +96,14 @@
alert("Error: Can't connect to the server."); alert("Error: Can't connect to the server.");
rollback = true; rollback = true;
thisTree.move_node(movedNode, data.old_parent, data.old_position); thisTree.move_node(movedNode, data.old_parent, data.old_position);
}); });
} }
else { else {
rollback = false; rollback = false;
} }
}); });
treeContainer.on('ready.jstree', function (event, data) {
Drupal.attachBehaviors(event.target);
});
treeContainer.on('open_node.jstree', function (event, data) { treeContainer.on('ready.jstree open_node.jstree move_node.jstree search.jstree clear_search.jstree', function (event, data) {
Drupal.attachBehaviors(event.target); Drupal.attachBehaviors(event.target);
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment