Skip to content
Snippets Groups Projects

Issue #3188871: Ajax Links for the dialog opening.

Merged Mingsong requested to merge issue/hierarchy_manager-3188871:3188871--ajax-links into 2.x
2 files
+ 16
33
Compare changes
  • Side-by-side
  • Inline
Files
2
  • 0869891a
    Issue #3188871 by dench0, elgandoz, Mingsong: Ajax Links for the dialog opening · 0869891a
    Denis K**** authored
@@ -103,39 +103,12 @@
}
});
// Node selected event.
treeContainer.on("select_node.jstree", function(event, data) {
var href = data.node.a_attr.href;
if (newWindow) {
window.open(href, "_self");
}
else {
Drupal.ajax({
url: href,
success: function(response) {
response.forEach(function(element) {
if (element.command && element.data) {
if (element.command === 'insert' && element.selector === null) {
$popDialog[offset] = $('<div>' + element.data + '</div>').appendTo('body');
}
}
});
if ($popDialog[offset]) {
let margin = parseInt(offset * 10 % 40);
let options = {
title: 'Edit ' + data.node.text,
minWidth: 600,
draggable: true,
resizable: true,
autoResize: false,
position: {'my': 'right bottom', 'at':'right-' + margin + ' bottom-' + margin},
};
Drupal.dialog($popDialog[offset++], options).show();
}
}
}).execute();
}
treeContainer.on('ready.jstree', function (event, data) {
Drupal.attachBehaviors(event.target);
});
treeContainer.on('open_node.jstree', function (event, data) {
Drupal.attachBehaviors(event.target);
});
// Search filter box.
Loading