You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
5.3 KiB
Plaintext

(function(e){var r=function(w,A,z,u,y,v,x){if(typeof z.isHidden=="string"){z.isHidden=q.eqs(z.isHidden,"true")}z.isHidden=!!z.isHidden;s.initHideForExCheck(w,z)},a=function(v,w,u){},h=function(w,v){v.showNodes=function(x,y){g.showNodes(w,x,y)};v.showNode=function(y,x){if(!y){return}g.showNodes(w,[y],x)};v.hideNodes=function(x,y){g.hideNodes(w,x,y)};v.hideNode=function(y,x){if(!y){return}g.hideNodes(w,[y],x)};var u=v.checkNode;if(u){v.checkNode=function(z,y,A,x){if(!!z&&!!z.isHidden){return}u.apply(v,arguments)}}},j={initHideForExCheck:function(u,v){if(v.isHidden&&u.check&&u.check.enable){if(typeof v._nocheck=="undefined"){v._nocheck=!!v.nocheck;v.nocheck=true}v.check_Child_State=-1;if(g.repairParentChkClassWithSelf){g.repairParentChkClassWithSelf(u,v)}}},initShowForExCheck:function(v,w){if(!w.isHidden&&v.check&&v.check.enable){if(typeof w._nocheck!="undefined"){w.nocheck=w._nocheck;delete w._nocheck}if(g.setChkClass){var u=e("#"+w.tId+k.id.CHECK);g.setChkClass(v,u,w)}if(g.repairParentChkClassWithSelf){g.repairParentChkClassWithSelf(v,w)}}}},c={clearOldFirstNode:function(u,v){var w=v.getNextNode();while(!!w){if(w.isFirstNode){w.isFirstNode=false;g.setNodeLineIcos(u,w);break}if(w.isLastNode){break}w=w.getNextNode()}},clearOldLastNode:function(u,v){var w=v.getPreNode();while(!!w){if(w.isLastNode){w.isLastNode=false;g.setNodeLineIcos(u,w);break}if(w.isFirstNode){break}w=w.getPreNode()}},makeDOMNodeMainBefore:function(u,v,w){u.push("<li ",(w.isHidden?"style='display:none;' ":""),"id='",w.tId,"' class='",k.className.LEVEL,w.level,"' tabindex='0' hidefocus='true' treenode>")},showNode:function(v,w,u){w.isHidden=false;s.initShowForExCheck(v,w);e("#"+w.tId).show()},showNodes:function(C,u,D){if(!u||u.length==0){return}var x={},A,z;for(A=0,z=u.length;A<z;A++){var w=u[A];if(!x[w.parentTId]){var y=w.getParentNode();x[w.parentTId]=(y===null)?s.getRoot(C):w.getParentNode()}g.showNode(C,w,D)}for(var B in x){var v=x[B][C.data.key.children];g.setFirstNodeForShow(C,v);g.setLastNodeForShow(C,v)}},hideNode:function(v,w,u){w.isHidden=true;w.isFirstNode=false;w.isLastNode=false;s.initHideForExCheck(v,w);g.cancelPreSelectedNode(v,w);e("#"+w.tId).hide()},hideNodes:function(C,u,D){if(!u||u.length==0){return}var x={},A,z;for(A=0,z=u.length;A<z;A++){var w=u[A];if((w.isFirstNode||w.isLastNode)&&!x[w.parentTId]){var y=w.getParentNode();x[w.parentTId]=(y===null)?s.getRoot(C):w.getParentNode()}g.hideNode(C,w,D)}for(var B in x){var v=x[B][C.data.key.children];g.setFirstNodeForHide(C,v);g.setLastNodeForHide(C,v)}},setFirstNode:function(v,u){var x=v.data.key.children,w=u[x].length;if(w>0&&!u[x][0].isHidden){u[x][0].isFirstNode=true}else{if(w>0){g.setFirstNodeForHide(v,u[x])}}},setLastNode:function(v,u){var x=v.data.key.children,w=u[x].length;if(w>0&&!u[x][0].isHidden){u[x][w-1].isLastNode=true}else{if(w>0){g.setLastNodeForHide(v,u[x])}}},setFirstNodeForHide:function(x,u){var y,w,v;for(w=0,v=u.length;w<v;w++){y=u[w];if(y.isFirstNode){break}if(!y.isHidden&&!y.isFirstNode){y.isFirstNode=true;g.setNodeLineIcos(x,y);break}else{y=null}}return y},setFirstNodeForShow:function(y,v){var A,x,w,z,u;for(x=0,w=v.length;x<w;x++){A=v[x];if(!z&&!A.isHidden&&A.isFirstNode){z=A;break}else{if(!z&&!A.isHidden&&!A.isFirstNode){A.isFirstNode=true;z=A;g.setNodeLineIcos(y,A)}else{if(z&&A.isFirstNode){A.isFirstNode=false;u=A;g.setNodeLineIcos(y,A);break}else{A=null}}}}return{"new":z,old:u}},setLastNodeForHide:function(w,u){var x,v;for(v=u.length-1;v>=0;v--){x=u[v];if(x.isLastNode){break}if(!x.isHidden&&!x.isLastNode){x.isLastNode=true;g.setNodeLineIcos(w,x);break}else{x=null}}return x},setLastNodeForShow:function(y,v){var A,x,w,z,u;for(x=v.length-1;x>=0;x--){A=v[x];if(!z&&!A.isHidden&&A.isLastNode){z=A;break}else{if(!z&&!A.isHidden&&!A.isLastNode){A.isLastNode=true;z=A;g.setNodeLineIcos(y,A)}else{if(z&&A.isLastNode){A.isLastNode=false;u=A;g.setNodeLineIcos(y,A);break}else{A=null}}}}return{"new":z,old:u}}},n={view:c,data:j};e.extend(true,e.fn.zTree._z,n);var b=e.fn.zTree,q=b._z.tools,k=b.consts,g=b._z.view,s=b._z.data,o=b._z.event;s.addInitNode(r);s.addBeforeA(a);s.addZTreeTools(h);var d=s.initNode;s.tmpHideParent=-1;s.initNode=function(C,u,y,z,B,A,w){if(s.tmpHideParent!==z){s.tmpHideParent=z;var x=(z)?z:s.getRoot(C),v=x[C.data.key.children];s.tmpHideFirstNode=g.setFirstNodeForHide(C,v);s.tmpHideLastNode=g.setLastNodeForHide(C,v);g.setNodeLineIcos(C,s.tmpHideFirstNode);g.setNodeLineIcos(C,s.tmpHideLastNode)}B=(s.tmpHideFirstNode===y);A=(s.tmpHideLastNode===y);if(d){d.apply(s,arguments)}if(A){g.clearOldLastNode(C,y)}};var p=s.makeChkFlag;if(!!p){s.makeChkFlag=function(u,v){if(!!v&&!!v.isHidden){return}p.apply(s,arguments)}}var f=s.getTreeCheckedNodes;if(!!f){s.getTreeCheckedNodes=function(w,u,x,v){if(!!u&&u.length>0){var y=u[0].getParentNode();if(!!y&&!!y.isHidden){return[]}}return f.apply(s,arguments)}}var l=s.getTreeChangeCheckedNodes;if(!!l){s.getTreeChangeCheckedNodes=function(w,u,v){if(!!u&&u.length>0){var x=u[0].getParentNode();if(!!x&&!!x.isHidden){return[]}}return l.apply(s,arguments)}}var m=g.expandCollapseSonNode;if(!!m){g.expandCollapseSonNode=function(u,v,x,w,y){if(!!v&&!!v.isHidden){return}m.apply(g,arguments)}}var t=g.setSonNodeCheckBox;if(!!t){g.setSonNodeCheckBox=function(u,v,w,x){if(!!v&&!!v.isHidden){return}t.apply(g,arguments)}}var i=g.repairParentChkClassWithSelf;if(!!i){g.repairParentChkClassWithSelf=function(u,v){if(!!v&&!!v.isHidden){return}i.apply(g,arguments)}}})(jQuery);