Skip to content
Snippets Groups Projects

Resolve #3443483 "Remember the position"

Files
2
+ 13
0
@@ -66,6 +66,7 @@
Drupal.TaxonomyManagerFancyTree = function (id, name, source) {
// Settings generated by http://wwwendt.de/tech/fancytree/demo/sample-configurator.html
$('#' + id).fancytree({
extensions: ["persist"],
activeVisible: true, // Make sure, active nodes are visible (expanded).
aria: false, // Enable WAI-ARIA support.
autoActivate: true, // Automatically activate a node when it is focused (using keys).
@@ -119,6 +120,18 @@
},
focus: function (event, data) {
new Drupal.TaxonomyManagerTermData(data.node.key, data.tree);
},
persist: {
expandLazy: true,
overrideSource: false,
store: 'session',
},
restore: function (event, data) {
// Check if the key exists in sessionStorage
if (sessionStorage.hasOwnProperty('fancytree-1-active')) {
// Open the active node.
new Drupal.TaxonomyManagerTermData(sessionStorage['fancytree-1-active'], data.tree);
}
}
});
};
Loading