ENHANCEMENT Allow disabling of tree drag'n'drop via input box

This commit is contained in:
Ingo Schommer 2011-03-03 14:05:10 +13:00
parent eb030fa0f9
commit a9cd7aa08c

View File

@ -48,12 +48,15 @@
},
'plugins': ['themes', 'html_data', 'ui', 'dnd', 'crrm']
})
// .bind('before.jstree', function(e, data) {
// if(data.func == 'drag_start') {
// // Only allow drag'n'drop if it has been specifically enabled
// return $('input[id=sortitems]').is(':checked');
// }
// })
.bind('before.jstree', function(e, data) {
if(data.func == 'start_drag') {
// Only allow drag'n'drop if it has been specifically enabled
if(!$('input[id=sortitems]').is(':checked')) {
e.stopImmediatePropagation();
return false;
}
}
})
// TODO Move to EditForm logic
.bind('select_node.jstree', function(e, data) {
var node = data.rslt.obj, loadedNodeID = $('#Form_EditForm :input[name=ID]').val()