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