in src/main/resources/SLING-INF/libs/sling/resource-editor/static/js/tree/JSTreeAdapter.js [100:118]
"check_move" : function (m) {
// you find the member description here
// http://www.jstree.com/documentation/core.html#_get_move
// TODO refactor to the new jsTree version
var src_li = m.o;
var src_nt = mainController.getNTFromLi(src_li);
var src_nodename = src_li.attr("nodename");
var new_parent_ul = m.np.children("ul");
var calculated_position = m.cp;
var liAlreadySelected = new_parent_ul.length==0 && m.np.prop("tagName").toUpperCase() == 'LI';
var dest_li = liAlreadySelected ? m.np : new_parent_ul.children("li:eq("+(calculated_position-1)+")");
var dest_nt = mainController.getNTFromLi(dest_li);
var result;
if (dest_nt != null){
result = dest_nt.canAddChildNode(src_nodename, src_nt);
}
return result;
}