mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT Allow disabling of tree drag'n'drop via input box
This commit is contained in:
parent
eb030fa0f9
commit
a9cd7aa08c
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user