diff --git a/modules/admin/tpl/js/menu_setup.js b/modules/admin/tpl/js/menu_setup.js index f85ef04ec..5c429f160 100644 --- a/modules/admin/tpl/js/menu_setup.js +++ b/modules/admin/tpl/js/menu_setup.js @@ -46,3 +46,180 @@ jQuery(function($){ }); }); +// menu - drag and drop +jQuery(function($){ + +var + dragging = false, + $holder = $('
  • '); + +$('div.adminMenu') + .delegate('li:not(.placeholder,.parent)', { + 'mousedown.st' : function(event) { + var $this, $uls, $ul, width, height, offset, position, offsets, i, dropzone, wrapper=''; + + if($(event.target).is('a,input,label,textarea') || event.which != 1) return; + + dragging = true; + + $this = $(this); + height = $this.height(); + width = $this.width(); + $uls = $this.parentsUntil('.siteMap').filter('ul'); + $ul = $uls.eq(-1); + + $ul.css('position', 'relative'); + + position = {x:event.pageX, y:event.pageY}; + offset = getOffset(this, $ul.get(0)); + + $clone = $this.clone(true).attr('target', true); + + for(i=$uls.length-1; i; i--) { + $clone = $clone.wrap('