mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 11:11:39 +09:00
/modules/admin/tpl/ UI cleaning.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11860 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
52bfda2a44
commit
0996153dae
5 changed files with 57 additions and 109 deletions
9
modules/admin/tpl/js/menu_setup.min.js
vendored
9
modules/admin/tpl/js/menu_setup.min.js
vendored
|
|
@ -1,8 +1 @@
|
|||
jQuery(function(b){function k(a){if(moduleList=a.menuList){var c=b("#menuNameList"),e;for(e in moduleList){var f=moduleList[e],a=b('<optgroup label="'+e+'" />').appendTo(c),d;for(d in f)a.append('<option value="'+e+":"+d+'">'+f[d].title+"</option>")}}}var d,h=b("#editForm"),a=b("#listForm");b("a._add").click(function(){d=b(this).parent().prevAll("._item_key").val();h.find("input[name=parent_srl]").val(d);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 c=0,e=0;a&&a!=b;)c+=a.offsetTop,e+=a.offsetLeft,a=a.offsetParent;return{top:c,left:e}}b("form.siteMap").delegate("li:not(.placeholder)","dropped.st",function(){var a=b(this),d;d=a.find(">input._parent_key");a.parent("ul").parent("li").length?d.val(a.parent("ul").parent("li").find(">input._item_key").val()):d.val("0")});var d=!1,h=b('<li class="placeholder">');b("div.adminMenu").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(a){var i,c,e,
|
||||
f,m,n,j,l,g;if(!(b(a.target).is("a,input,label,textarea")||1!=a.which)){d=!0;c=b(this);n=c.height();m=c.width();e=c.parentsUntil(".siteMap").filter("ul");f=e.eq(-1);f.css("position","relative");i=a.pageY;j=k(this,f.get(0));$clone=c.clone(!0).attr("target",!0);for(a=e.length-1;a;a--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();l=[];f.find("li").each(function(){if(c[0]===this||c.has(this).length)return!0;var a=k(this,f.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(f.eq(0));h.css({position:"absolute",opacity:0.6,width:m,height:"10px",left:j.left,top:j.top,zIndex:99}).appendTo(f.eq(0));c.css("opacity",0.6);b(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,d;g=null;a=j.top-(i-a.pageY);b=0;for(c=l.length;b<c;b++)d=l[b],d.top>a||d.bottom<a||(g={element:d.$item},d.$item.hasClass("parent")?(g.state="prepend",h.css("top",d.bottom-5)):d.top>a-12?(g.state="before",
|
||||
h.css("top",d.top-5)):(g.state="after",h.css("top",d.bottom-5)));$clone.css({top:a})}).bind("mouseup.st",function(){var a,e;d=!1;b(document).unbind("mousemove.st mouseup.st");c.css("opacity","");$clone.remove();h.remove();e=b("<li />").height(c.height());if(g){a=b(g.element);c.before(e);if("prepend"==g.state)a.find(">ul").length||a.find(">.side").after("<ul>"),a.find(">ul").prepend(c.hide());else a[g.state](c.hide());c.slideDown(100,function(){c.removeClass("active")});e.slideUp(100,function(){var a=
|
||||
e.parent();e.remove();a.children("li").length||a.remove()});c.trigger("dropped.st")}});return!1}},"mouseover.st":function(){d||b(this).addClass("active");return!1},"mouseout.st":function(){d||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")});
|
||||
jQuery(function(e){var d;var f;var a=e("#editForm");var c=e("#listForm");e("a._add").click(function(){f=e(this).parent().prevAll("._item_key").val();a.find("input[name=parent_srl]").val(f);if(!d){var h=new Array();var g=new Array("menuList");exec_xml("menu","procMenuAdminAllActList",h,b,g);}});function b(k){var h;moduleList=k.menuList;if(moduleList){var i=e("#menuNameList");for(var g in moduleList){var j=moduleList[g];h=e('<optgroup label="'+g+'" />').appendTo(i);for(var l in j){h.append('<option value="'+g+":"+l+'">'+j[l].title+"</option>");}}}}e("a._parent_delete").click(function(){var g=e(this).parent().prevAll("._parent_key").val();c.find("input[name=menu_item_srl]").val(g);c.submit();});e("a._child_delete").click(function(){var g=e(this).parents("li").find("._item_key").val();c.find("input[name=menu_item_srl]").val(g);c.submit();});});jQuery(function(d){d("form.adminMap").delegate("li:not(.placeholder)","dropped.st",function(){var h=d(this),g,e,f;g=h.find(">input._parent_key");f=!!h.parent("ul").parent("li").length;if(f){g.val(h.parent("ul").parent("li").find(">input._item_key").val());}else{g.val("0");}});var c=false,b=d('<li class="placeholder">');d("form.adminMap>ul").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(f){var o,m,l,g,q,j,n,h,k,p,e="";if(d(f.target).is("a,input,label,textarea")||f.which!=1){return;}c=true;o=d(this);q=o.height();g=o.width();m=o.parentsUntil(".adminMap").filter("ul");l=m.eq(-1);n={x:f.pageX,y:f.pageY};j=a(this,l.get(0));$clone=o.clone(true).attr("target",true);for(k=m.length-1;k;k--){$clone=$clone.wrap("<li><ul /></li>").parent().parent();}h=[];l.find("li").each(function(i){if(o[0]===this||o.has(this).length){return true;}var r=a(this,l.get(0));h.push({top:r.top,bottom:r.top+32,$item:d(this)});});$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:0.6,width:g,height:q,left:j.left,top:j.top,zIndex:100}).appendTo(l.eq(0));b.css({position:"absolute",opacity:0.6,width:g,height:"10px",left:j.left,top:j.top,zIndex:99}).appendTo(l.eq(0));o.css("opacity",0.6);d(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(u){var v,s,t,r,x,w;p=null;v={x:n.x-u.pageX,y:n.y-u.pageY};s=j.top-v.y;for(r=0,x=h.length;r<x;r++){w=h[r];if(w.top>s||w.bottom<s){continue;}p={element:w.$item};if(w.$item.hasClass("parent")){p.state="prepend";b.css("top",w.bottom-5);}else{if(w.top>s-12){p.state="before";b.css("top",w.top-5);}else{p.state="after";b.css("top",w.bottom-5);}}}$clone.css({top:s});}).bind("mouseup.st",function(i){var s,r;c=false;d(document).unbind("mousemove.st mouseup.st");o.css("opacity","");$clone.remove();b.remove();r=d("<li />").height(o.height());if(!p){return;}s=d(p.element);o.before(r);if(p.state=="prepend"){if(!s.find(">ul").length){s.find(">.side").after("<ul>");}s.find(">ul").prepend(o.hide());}else{s[p.state](o.hide());}o.slideDown(100,function(){o.removeClass("active");});r.slideUp(100,function(){var t=r.parent();r.remove();if(!t.children("li").length){t.remove();}});o.trigger("dropped.st");});return false;},"mouseover.st":function(){if(!c){d(this).addClass("active");}return false;},"mouseout.st":function(){if(!c){d(this).removeClass("active");}return false;}}).find("li li").prepend('<button type="button" class="moveTo">Move to</button>').end().end();d('<div id="dropzone-marker" />').css({display:"none",position:"absolute",backgroundColor:"#000",opacity:0.7}).appendTo("body");function a(f,e){var h=0,g=0;while(f&&f!=e){h+=f.offsetTop;g+=f.offsetLeft;f=f.offsetParent;}return{top:h,left:g};}});
|
||||
Loading…
Add table
Add a link
Reference in a new issue