mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9375 201d5d3c-b55e-5fd7-737f-ddc643e51545
8 lines
3.3 KiB
JavaScript
8 lines
3.3 KiB
JavaScript
jQuery(function(b){function k(a){if(moduleList=a.menuList){var d=b("#menuNameList"),g;for(g in moduleList){var e=moduleList[g],a=b('<optgroup label="'+g+'" />').appendTo(d),c;for(c in e)a.append('<option value="'+g+":"+c+'">'+e[c].title+"</option>")}}}var c,h=b("#editForm"),a=b("#listForm");b("a._add").click(function(){c=b(this).parent().prevAll("._item_key").val();h.find("input[name=parent_srl]").val(c);exec_xml("menu","procMenuAdminAllActList",[],k,["menuList"])});b("a._parent_delete").click(function(){var i=
|
|
b(this).parent().prevAll("._parent_key").val();a.find("input[name=menu_item_srl]").val(i);a.submit()});b("a._child_delete").click(function(){var i=b(this).parents("li").find("._item_key").val();a.find("input[name=menu_item_srl]").val(i);a.submit()})});
|
|
jQuery(function(b){function k(a,b){for(var d=0,c=0;a&&a!=b;)d+=a.offsetTop,c+=a.offsetLeft,a=a.offsetParent;return{top:d,left:c}}b("form.siteMap").delegate("li:not(.placeholder)","dropped.st",function(){var a=b(this),c;c=a.find(">input._parent_key");a.parent("ul").parent("li").length?c.val(a.parent("ul").parent("li").find(">input._item_key").val()):c.val("0")});var c=!1,h=b('<li class="placeholder">');b("div.adminMenu").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(a){var i,d,g,
|
|
e,m,n,j,l,f;if(!(b(a.target).is("a,input,label,textarea")||a.which!=1)){c=!0;d=b(this);n=d.height();m=d.width();g=d.parentsUntil(".siteMap").filter("ul");e=g.eq(-1);e.css("position","relative");i=a.pageY;j=k(this,e.get(0));$clone=d.clone(!0).attr("target",!0);for(a=g.length-1;a;a--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();l=[];e.find("li").each(function(){if(d[0]===this||d.has(this).length)return!0;var a=k(this,e.get(0));l.push({top:a.top,bottom:a.top+32,$item:b(this)})});$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",
|
|
opacity:0.6,width:m,height:n,left:j.left,top:j.top,zIndex:100}).appendTo(e.eq(0));h.css({position:"absolute",opacity:0.6,width:m,height:"10px",left:j.left,top:j.top,zIndex:99}).appendTo(e.eq(0));d.css("opacity",0.6);b(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,d,c;f=null;a=j.top-(i-a.pageY);for(b=0,d=l.length;b<d;b++)if(c=l[b],!(c.top>a||c.bottom<a))f={element:c.$item},c.$item.hasClass("parent")?(f.state="prepend",h.css("top",c.bottom-5)):c.top>a-12?(f.state=
|
|
"before",h.css("top",c.top-5)):(f.state="after",h.css("top",c.bottom-5));$clone.css({top:a})}).bind("mouseup.st",function(){var a,e;c=!1;b(document).unbind("mousemove.st mouseup.st");d.css("opacity","");$clone.remove();h.remove();e=b("<li />").height(d.height());if(f){a=b(f.element);d.before(e);if(f.state=="prepend")a.find(">ul").length||a.find(">.side").after("<ul>"),a.find(">ul").prepend(d.hide());else a[f.state](d.hide());d.slideDown(100,function(){d.removeClass("active")});e.slideUp(100,function(){var a=
|
|
e.parent();e.remove();a.children("li").length||a.remove()});d.trigger("dropped.st")}});return!1}},"mouseover.st":function(){c||b(this).addClass("active");return!1},"mouseout.st":function(){c||b(this).removeClass("active");return!1}}).find("li").prepend('<button type="button" class="moveTo">Move to</button>').filter(".parent").find(">button.moveTo").css({visibility:"hidden","margin-left":"-12px"}).end().end().end();b('<div id="dropzone-marker" />').css({display:"none",position:"absolute",backgroundColor:"#000",
|
|
opacity:0.7}).appendTo("body")});
|