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
1 merge request!2Issue #3191599: Modal not opening after search/drag-and-drop
......@@ -27,7 +27,7 @@
};
let options;
var offset = 0;
if (optionsJson) {
options = JSON.parse(optionsJson);
if (options.theme) {
......@@ -58,12 +58,12 @@
},
plugins: ["search", "dnd"]
});
// Node move event.
treeContainer.on("move_node.jstree", function(event, data) {
const thisTree = data.instance;
const movedNode = data.node;
if (!rollback) {
let list = thisTree.get_node(data.parent).children;
let before = '';
......@@ -71,7 +71,7 @@
if (data.position > 0) {
before = list[data.position - 1];
}
if (data.position < list.length - 1) {
after = list[data.position + 1];
}
......@@ -96,18 +96,14 @@
alert("Error: Can't connect to the server.");
rollback = true;
thisTree.move_node(movedNode, data.old_parent, data.old_position);
});
});
}
else {
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);
});
......
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