Fixes on reordering categories

This commit is contained in:
Ludovic CANDELLIER
2020-07-06 00:35:08 +02:00
parent 0ad31dac19
commit d8bd1a1713
11 changed files with 148 additions and 29 deletions

View File

@@ -7,7 +7,7 @@
<script src="/modules/fancytree/jquery.fancytree-all-deps.min.js"></script>
<script>
$(function(){
$(function() {
// Initialize Fancytree
$("#tree").fancytree({
extensions: ["childcounter", "dnd5", "edit", "glyph", "wide"],
@@ -15,13 +15,31 @@
checkbox: false,
selectMode: 3,
dnd5: {
dragStart: function(node, data) { return true; },
dragEnter: function(node, data) { return true; },
dragDrop: function(node, data) { data.otherNode.copyTo(node, data.hitMode); }
dragStart: function(node, data) {
return true;
},
dragEnter: function(node, data) {
return true;
},
dragDrop: function(node, data) {
alert("Drop on " + node + ":\n"
+ "source:" + JSON.stringify(data.otherNodeData) + "\n"
+ "hitMode:" + data.hitMode
+ ", dropEffect:" + data.dropEffect
+ ", effectAllowed:" + data.effectAllowed);
console.log(node);
console.log(data);
data.otherNode.copyTo(node, data.hitMode);
}
},
glyph: glyph_opts,
// source: {url: "ajax-tree-taxonomy.json", debugDelay: 1000},
source: {url: "ajax-tree-products.json", debugDelay: 1000},
source: {
url: "ajax-tree-products.json",
debugDelay: 1000
},
// toggleEffect: { effect: "drop", options: {direction: "left"}, duration: 400 },
wide: {
iconWidth: "1em", // Adjust this if @fancy-icon-width != "16px"
@@ -40,7 +58,10 @@
// }
},
lazyLoad: function(event, data) {
data.result = {url: "ajax-sub2.json", debugDelay: 1000};
data.result = {
url: "ajax-sub2.json",
debugDelay: 1000
};
}
});
};