提交 0cde2ca9 编写于 作者: Z zTreeAPI

replace 3.5.47

上级 6b5af60f
jQuery Tree Plugin ---- zTree
============
last version : 3.5.47
last version : 3.5.48
**Donate to zTree** : http://www.treejs.cn/v3/donate.php
......
......@@ -35,7 +35,7 @@
<div class="ieSuggest">浏览本网站建议您使用 Chrome、FireFox、Opera、IE9 等浏览器(只要不是 IE6 7 8 就行), 速度会更快,画面会更炫!</div>
<div class="google_plus"><g:plusone></g:plusone></div>
<div class="header-text">
<h1><em>zTree v3.5.46 API 文档</em></h1><p></p>
<h1><em>zTree v3.5.48 API 文档</em></h1><p></p>
<p>all.js = core + excheck + exedit ( 不包括 exhide ); 发现错误请及时通知,谢谢。</p>
</div>
<ul class="shortcuts language" style="top:0;">
......
......@@ -34,7 +34,7 @@
<div class="ieSuggest">If you use the Chrome / FireFox / Opera / IE9 browser will be even more dazzling effect!</div>
<div class="google_plus"><g:plusone></g:plusone></div>
<div class="header-text">
<h1><em>zTree v3.5.46 API Document</em></h1><p></p>
<h1><em>zTree v3.5.48 API Document</em></h1><p></p>
<p>all.js = core + excheck + exedit ( without exhide ); if you found some mistakes please contact me.</p>
</div>
<ul class="shortcuts language" style="top:0;">
......
此差异已折叠。
......@@ -10,6 +10,7 @@
<script type="text/javascript" src="../../../js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="../../../js/jquery.ztree.exedit.js"></script>
<SCRIPT type="text/javascript">
<!--
var setting = {
edit: {
enable: true,
......@@ -92,6 +93,7 @@
$("#inner").bind("change", setCheck);
$("#next").bind("change", setCheck);
});
//-->
</SCRIPT>
</HEAD>
......
......@@ -10,6 +10,7 @@
<!-- <script type="text/javascript" src="../../../js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="../../../js/jquery.ztree.exedit.js"></script>-->
<SCRIPT type="text/javascript">
<!--
var setting = {
view: {
dblClickExpand: false,
......@@ -52,6 +53,7 @@
$(document).ready(function(){
$.fn.zTree.init($("#treeDemo"), setting, zNodes);
});
//-->
</SCRIPT>
<style type="text/css">
.ztree li button.switch {visibility:hidden; width:1px;}
......
/*
* JQuery zTree core * v3.5.47
* JQuery zTree core
* v3.5.48
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
......@@ -10,6 +10,7 @@
*
* Date: 2020-11-21
*/
(function ($) {
var settings = {}, roots = {}, caches = {},
//default consts of core
......@@ -2017,7 +2018,8 @@
consts = zt.consts;
})(jQuery);
/*
* JQuery zTree excheck * v3.5.47
* JQuery zTree excheck
* v3.5.48
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
......@@ -2027,6 +2029,7 @@
*
* Date: 2020-11-21
*/
(function ($) {
//default consts of excheck
var _consts = {
......@@ -2667,7 +2670,8 @@
}
})(jQuery);
/*
* JQuery zTree exedit * v3.5.47
* JQuery zTree exedit
* v3.5.48
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
......@@ -2677,6 +2681,7 @@
*
* Date: 2020-11-21
*/
(function ($) {
//default consts of exedit
var _consts = {
......@@ -3870,4 +3875,4 @@
}
return (!root.curEditNode) && (_uCanDo ? _uCanDo.apply(view, arguments) : true);
}
})(jQuery);
})(jQuery);
\ No newline at end of file
此差异已折叠。
/*
* JQuery zTree core * v3.5.47
* JQuery zTree core
* v3.5.48
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
......@@ -9,6 +10,7 @@
*
* Date: 2020-11-21
*/
(function ($) {
var settings = {}, roots = {}, caches = {},
//default consts of core
......
此差异已折叠。
/*
* JQuery zTree excheck * v3.5.47
* JQuery zTree excheck
* v3.5.48
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
......@@ -9,6 +10,7 @@
*
* Date: 2020-11-21
*/
(function ($) {
//default consts of excheck
var _consts = {
......
/*
* JQuery zTree excheck * v3.5.47
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
*
* Licensed same as jquery - MIT License
* http://www.opensource.org/licenses/mit-license.php
*
* Date: 2020-11-21
*/
!function(e){var t={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},c={check:{enable:!1,autoCheckTrigger:!1,chkStyle:t.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:t.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}},r={onCheckNode:function(e,t){if(!0===t.chkDisabled)return!1;var c=C.getSetting(e.data.treeId);if(0==o.apply(c.callback.beforeCheck,[c.treeId,t],!0))return!0;var h=C.nodeChecked(c,t);C.nodeChecked(c,t,!h),l.checkNodeRelation(c,t);var a=f(t,s.id.CHECK,c);return l.setChkClass(c,a,t),l.repairParentChkClassWithSelf(c,t),c.treeObj.trigger(s.event.CHECK,[e,c.treeId,t]),!0},onMouseoverCheck:function(e,t){if(!0===t.chkDisabled)return!1;var c=C.getSetting(e.data.treeId),h=f(t,s.id.CHECK,c);return t.check_Focus=!0,l.setChkClass(c,h,t),!0},onMouseoutCheck:function(e,t){if(!0===t.chkDisabled)return!1;var c=C.getSetting(e.data.treeId),h=f(t,s.id.CHECK,c);return t.check_Focus=!1,l.setChkClass(c,h,t),!0}},h={tools:{},view:{checkNodeRelation:function(e,t){var c,h,a,n=s.radio,i=C.nodeChecked(e,t);if(e.check.chkStyle==n.STYLE){var r=C.getRadioCheckedList(e);if(i)if(e.check.radioType==n.TYPE_ALL){for(h=r.length-1;0<=h;h--){c=r[h],C.nodeChecked(e,c)&&c!=t&&(C.nodeChecked(e,c,!1),r.splice(h,1),l.setChkClass(e,f(c,s.id.CHECK,e),c),c.parentTId!=t.parentTId&&l.repairParentChkClassWithSelf(e,c))}r.push(t)}else{var o=t.parentTId?t.getParentNode():C.getRoot(e);for(h=0,a=(d=C.nodeChildren(e,o)).length;h<a;h++){c=d[h],C.nodeChecked(e,c)&&c!=t&&(C.nodeChecked(e,c,!1),l.setChkClass(e,f(c,s.id.CHECK,e),c))}}else if(e.check.radioType==n.TYPE_ALL)for(h=0,a=r.length;h<a;h++)if(t==r[h]){r.splice(h,1);break}}else{var d=C.nodeChildren(e,t);i&&(!d||0==d.length||-1<e.check.chkboxType.Y.indexOf("s"))&&l.setSonNodeCheckBox(e,t,!0),i||d&&0!=d.length&&!(-1<e.check.chkboxType.N.indexOf("s"))||l.setSonNodeCheckBox(e,t,!1),i&&-1<e.check.chkboxType.Y.indexOf("p")&&l.setParentNodeCheckBox(e,t,!0),!i&&-1<e.check.chkboxType.N.indexOf("p")&&l.setParentNodeCheckBox(e,t,!1)}},makeChkClass:function(e,t){var c=s.checkbox,h=s.radio,a="",n=C.nodeChecked(e,t);a=!0===t.chkDisabled?c.DISABLED:t.halfCheck?c.PART:e.check.chkStyle==h.STYLE?t.check_Child_State<1?c.FULL:c.PART:n?2===t.check_Child_State||-1===t.check_Child_State?c.FULL:c.PART:t.check_Child_State<1?c.FULL:c.PART;var i=e.check.chkStyle+"_"+(n?c.TRUE:c.FALSE)+"_"+a;return i=t.check_Focus&&!0!==t.chkDisabled?i+"_"+c.FOCUS:i,s.className.BUTTON+" "+c.DEFAULT+" "+i},repairAllChk:function(e,t){if(e.check.enable&&e.check.chkStyle===s.checkbox.STYLE)for(var c=C.getRoot(e),h=C.nodeChildren(e,c),a=0,n=h.length;a<n;a++){var i=h[a];!0!==i.nocheck&&!0!==i.chkDisabled&&C.nodeChecked(e,i,t),l.setSonNodeCheckBox(e,i,t)}},repairChkClass:function(e,t){if(t&&(C.makeChkFlag(e,t),!0!==t.nocheck)){var c=f(t,s.id.CHECK,e);l.setChkClass(e,c,t)}},repairParentChkClass:function(e,t){if(t&&t.parentTId){var c=t.getParentNode();l.repairChkClass(e,c),l.repairParentChkClass(e,c)}},repairParentChkClassWithSelf:function(e,t){if(t){var c=C.nodeChildren(e,t);c&&0<c.length?l.repairParentChkClass(e,c[0]):l.repairParentChkClass(e,t)}},repairSonChkDisabled:function(e,t,c,h){if(t){t.chkDisabled!=c&&(t.chkDisabled=c),l.repairChkClass(e,t);var a=C.nodeChildren(e,t);if(a&&h)for(var n=0,i=a.length;n<i;n++){var r=a[n];l.repairSonChkDisabled(e,r,c,h)}}},repairParentChkDisabled:function(e,t,c,h){t&&(t.chkDisabled!=c&&h&&(t.chkDisabled=c),l.repairChkClass(e,t),l.repairParentChkDisabled(e,t.getParentNode(),c,h))},setChkClass:function(e,t,c){t&&(!0===c.nocheck?t.hide():t.show(),t.attr("class",l.makeChkClass(e,c)))},setParentNodeCheckBox:function(e,t,c,h){var a=f(t,s.id.CHECK,e);if(h=h||t,C.makeChkFlag(e,t),!0!==t.nocheck&&!0!==t.chkDisabled&&(C.nodeChecked(e,t,c),l.setChkClass(e,a,t),e.check.autoCheckTrigger&&t!=h&&e.treeObj.trigger(s.event.CHECK,[null,e.treeId,t])),t.parentTId){var n=!0;if(!c)for(var i=C.nodeChildren(e,t.getParentNode()),r=0,o=i.length;r<o;r++){var d=i[r],k=C.nodeChecked(e,d);if(!0!==d.nocheck&&!0!==d.chkDisabled&&k||(!0===d.nocheck||!0===d.chkDisabled)&&0<d.check_Child_State){n=!1;break}}n&&l.setParentNodeCheckBox(e,t.getParentNode(),c,h)}},setSonNodeCheckBox:function(e,t,c,h){if(t){var a=f(t,s.id.CHECK,e);h=h||t;var n=!1,i=C.nodeChildren(e,t);if(i)for(var r=0,o=i.length;r<o;r++){var d=i[r];l.setSonNodeCheckBox(e,d,c,h),!0===d.chkDisabled&&(n=!0)}t!=C.getRoot(e)&&!0!==t.chkDisabled&&(n&&!0!==t.nocheck&&C.makeChkFlag(e,t),!0!==t.nocheck&&!0!==t.chkDisabled?(C.nodeChecked(e,t,c),n||(t.check_Child_State=i&&0<i.length?c?2:0:-1)):t.check_Child_State=-1,l.setChkClass(e,a,t),e.check.autoCheckTrigger&&t!=h&&!0!==t.nocheck&&!0!==t.chkDisabled&&e.treeObj.trigger(s.event.CHECK,[null,e.treeId,t]))}}},event:{},data:{getRadioCheckedList:function(e){for(var t=C.getRoot(e).radioCheckedList,c=0,h=t.length;c<h;c++)C.getNodeCache(e,t[c].tId)||(t.splice(c,1),c--,h--);return t},getCheckStatus:function(e,t){if(!e.check.enable||t.nocheck||t.chkDisabled)return null;var c=C.nodeChecked(e,t);return{checked:c,half:t.halfCheck?t.halfCheck:e.check.chkStyle==s.radio.STYLE?2===t.check_Child_State:c?-1<t.check_Child_State&&t.check_Child_State<2:0<t.check_Child_State}},getTreeCheckedNodes:function(e,t,c,h){if(!t)return[];var a=c&&e.check.chkStyle==s.radio.STYLE&&e.check.radioType==s.radio.TYPE_ALL;h=h||[];for(var n=0,i=t.length;n<i;n++){var r=t[n],o=C.nodeChildren(e,r),d=C.nodeChecked(e,r);if(!0!==r.nocheck&&!0!==r.chkDisabled&&d==c&&(h.push(r),a))break;if(C.getTreeCheckedNodes(e,o,c,h),a&&0<h.length)break}return h},getTreeChangeCheckedNodes:function(e,t,c){if(!t)return[];c=c||[];for(var h=0,a=t.length;h<a;h++){var n=t[h],i=C.nodeChildren(e,n),r=C.nodeChecked(e,n);!0!==n.nocheck&&!0!==n.chkDisabled&&r!=n.checkedOld&&c.push(n),C.getTreeChangeCheckedNodes(e,i,c)}return c},makeChkFlag:function(e,t){if(t){var c=-1,h=C.nodeChildren(e,t);if(h)for(var a=0,n=h.length;a<n;a++){var i=h[a],r=C.nodeChecked(e,i),o=-1;if(e.check.chkStyle==s.radio.STYLE){if(2==(o=!0===i.nocheck||!0===i.chkDisabled?i.check_Child_State:!0===i.halfCheck||r||0<i.check_Child_State?2:0)){c=2;break}0==o&&(c=0)}else if(e.check.chkStyle==s.checkbox.STYLE){if(1===(o=!0===i.nocheck||!0===i.chkDisabled?i.check_Child_State:!0===i.halfCheck?1:r?-1===i.check_Child_State||2===i.check_Child_State?2:1:0<i.check_Child_State?1:0)){c=1;break}if(2===o&&-1<c&&0<a&&o!==c){c=1;break}if(2===c&&-1<o&&o<2){c=1;break}-1<o&&(c=o)}}t.check_Child_State=c}}}};e.extend(!0,e.fn.zTree.consts,t),e.extend(!0,e.fn.zTree._z,h);var a=e.fn.zTree,o=a._z.tools,s=a.consts,l=a._z.view,C=a._z.data,f=(a._z.event,o.$);C.nodeChecked=function(e,t,c){if(!t)return!1;var h=e.data.key.checked;return void 0!==c?("string"==typeof c&&(c=o.eqs(c,"true")),c=!!c,t[h]=c):"string"==typeof t[h]?t[h]=o.eqs(t[h],"true"):t[h]=!!t[h],t[h]},C.exSetting(c),C.addInitBind(function(a){var e=a.treeObj,t=s.event;e.bind(t.CHECK,function(e,t,c,h){e.srcEvent=t,o.apply(a.callback.onCheck,[e,c,h])})}),C.addInitUnBind(function(e){var t=e.treeObj,c=s.event;t.unbind(c.CHECK)}),C.addInitCache(function(e){}),C.addInitNode(function(e,t,c,h,a,n,i){if(c){var r=C.nodeChecked(e,c);if(c.checkedOld=r,"string"==typeof c.nocheck&&(c.nocheck=o.eqs(c.nocheck,"true")),c.nocheck=!!c.nocheck||e.check.nocheckInherit&&h&&!!h.nocheck,"string"==typeof c.chkDisabled&&(c.chkDisabled=o.eqs(c.chkDisabled,"true")),c.chkDisabled=!!c.chkDisabled||e.check.chkDisabledInherit&&h&&!!h.chkDisabled,"string"==typeof c.halfCheck&&(c.halfCheck=o.eqs(c.halfCheck,"true")),c.halfCheck=!!c.halfCheck,c.check_Child_State=-1,c.check_Focus=!1,c.getCheckStatus=function(){return C.getCheckStatus(e,c)},e.check.chkStyle==s.radio.STYLE&&e.check.radioType==s.radio.TYPE_ALL&&r)C.getRoot(e).radioCheckedList.push(c)}}),C.addInitProxy(function(e){var t=e.target,c=C.getSetting(e.data.treeId),h="",a=null,n="",i=null;if(o.eqs(e.type,"mouseover")?c.check.enable&&o.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+s.id.CHECK)&&(h=o.getNodeMainDom(t).id,n="mouseoverCheck"):o.eqs(e.type,"mouseout")?c.check.enable&&o.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+s.id.CHECK)&&(h=o.getNodeMainDom(t).id,n="mouseoutCheck"):o.eqs(e.type,"click")&&c.check.enable&&o.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+s.id.CHECK)&&(h=o.getNodeMainDom(t).id,n="checkNode"),0<h.length)switch(a=C.getNodeCache(c,h),n){case"checkNode":i=r.onCheckNode;break;case"mouseoverCheck":i=r.onMouseoverCheck;break;case"mouseoutCheck":i=r.onMouseoutCheck}return{stop:"checkNode"===n,node:a,nodeEventType:n,nodeEventCallback:i,treeEventType:"",treeEventCallback:null}},!0),C.addInitRoot(function(e){C.getRoot(e).radioCheckedList=[]}),C.addBeforeA(function(e,t,c){e.check.enable&&(C.makeChkFlag(e,t),c.push("<span ID='",t.tId,s.id.CHECK,"' class='",l.makeChkClass(e,t),"' treeNode",s.id.CHECK,!0===t.nocheck?" style='display:none;'":"","></span>"))}),C.addZTreeTools(function(i,h){h.checkNode=function(e,t,c,h){var a=C.nodeChecked(i,e);if(!0!==e.chkDisabled&&(!0!==t&&!1!==t&&(t=!a),h=!!h,(a!==t||c)&&(!h||0!=o.apply(this.setting.callback.beforeCheck,[this.setting.treeId,e],!0))&&o.uCanDo(this.setting)&&this.setting.check.enable&&!0!==e.nocheck)){C.nodeChecked(i,e,t);var n=f(e,s.id.CHECK,this.setting);!c&&this.setting.check.chkStyle!==s.radio.STYLE||l.checkNodeRelation(this.setting,e),l.setChkClass(this.setting,n,e),l.repairParentChkClassWithSelf(this.setting,e),h&&this.setting.treeObj.trigger(s.event.CHECK,[null,this.setting.treeId,e])}},h.checkAllNodes=function(e){l.repairAllChk(this.setting,!!e)},h.getCheckedNodes=function(e){e=!1!==e;var t=C.nodeChildren(i,C.getRoot(this.setting));return C.getTreeCheckedNodes(this.setting,t,e)},h.getChangeCheckedNodes=function(){var e=C.nodeChildren(i,C.getRoot(this.setting));return C.getTreeChangeCheckedNodes(this.setting,e)},h.setChkDisabled=function(e,t,c,h){t=!!t,c=!!c,h=!!h,l.repairSonChkDisabled(this.setting,e,t,h),l.repairParentChkDisabled(this.setting,e.getParentNode(),t,c)};var a=h.updateNode;h.updateNode=function(e,t){if((a&&a.apply(h,arguments),e&&this.setting.check.enable)&&(f(e,this.setting).get(0)&&o.uCanDo(this.setting))){var c=f(e,s.id.CHECK,this.setting);1!=t&&this.setting.check.chkStyle!==s.radio.STYLE||l.checkNodeRelation(this.setting,e),l.setChkClass(this.setting,c,e),l.repairParentChkClassWithSelf(this.setting,e)}}});var n=l.createNodes;l.createNodes=function(e,t,c,h,a){n&&n.apply(l,arguments),c&&l.repairParentChkClassWithSelf(e,h)};var i=l.removeNode;l.removeNode=function(e,t){var c=t.getParentNode();i&&i.apply(l,arguments),t&&c&&(l.repairChkClass(e,c),l.repairParentChkClass(e,c))};var d=l.appendNodes;l.appendNodes=function(e,t,c,h,a,n,i){var r="";return d&&(r=d.apply(l,arguments)),h&&C.makeChkFlag(e,h),r}}(jQuery);
\ No newline at end of file
/*
* JQuery zTree exedit * v3.5.47
* JQuery zTree exedit
* v3.5.48
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
......@@ -9,6 +10,7 @@
*
* Date: 2020-11-21
*/
(function ($) {
//default consts of exedit
var _consts = {
......
此差异已折叠。
/*
* JQuery zTree exHideNodes * v3.5.47
* JQuery zTree exHideNodes
* v3.5.48
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
......@@ -9,6 +10,7 @@
*
* Date: 2020-11-21
*/
(function ($) {
var _setting = {
data: {
......
/*
* JQuery zTree exHideNodes * v3.5.47
* http://treejs.cn/
*
* Copyright (c) 2010 Hunter.z
*
* Licensed same as jquery - MIT License
* http://www.opensource.org/licenses/mit-license.php
*
* Date: 2020-11-21
*/
!function(e){var i={view:{clearOldFirstNode:function(e,i){for(var o=i.getNextNode();o;){if(o.isFirstNode){o.isFirstNode=!1,c.setNodeLineIcos(e,o);break}if(o.isLastNode)break;o=o.getNextNode()}},clearOldLastNode:function(e,i,o){for(var d=i.getPreNode();d;){if(d.isLastNode){d.isLastNode=!1,o&&c.setNodeLineIcos(e,d);break}if(d.isFirstNode)break;d=d.getPreNode()}},makeDOMNodeMainBefore:function(e,i,o){var d=h.isHidden(i,o);e.push("<li ",d?"style='display:none;' ":"","id='",o.tId,"' class='",n.className.LEVEL,o.level,"' tabindex='0' hidefocus='true' treenode>")},showNode:function(e,i,o){h.isHidden(e,i,!1),h.initShowForExCheck(e,i),d(i,e).show()},showNodes:function(e,i,o){if(i&&0!=i.length){var d,t,n={};for(d=0,t=i.length;d<t;d++){var s=i[d];if(!n[s.parentTId]){var r=s.getParentNode();n[s.parentTId]=null===r?h.getRoot(e):s.getParentNode()}c.showNode(e,s,o)}for(var a in n){var N=h.nodeChildren(e,n[a]);c.setFirstNodeForShow(e,N),c.setLastNodeForShow(e,N)}}},hideNode:function(e,i,o){h.isHidden(e,i,!0),i.isFirstNode=!1,i.isLastNode=!1,h.initHideForExCheck(e,i),c.cancelPreSelectedNode(e,i),d(i,e).hide()},hideNodes:function(e,i,o){if(i&&0!=i.length){var d,t,n={};for(d=0,t=i.length;d<t;d++){var s=i[d];if((s.isFirstNode||s.isLastNode)&&!n[s.parentTId]){var r=s.getParentNode();n[s.parentTId]=null===r?h.getRoot(e):s.getParentNode()}c.hideNode(e,s,o)}for(var a in n){var N=h.nodeChildren(e,n[a]);c.setFirstNodeForHide(e,N),c.setLastNodeForHide(e,N)}}},setFirstNode:function(e,i){var o=h.nodeChildren(e,i),d=h.isHidden(e,o[0],!1);0<o.length&&!d?o[0].isFirstNode=!0:0<o.length&&c.setFirstNodeForHide(e,o)},setLastNode:function(e,i){var o=h.nodeChildren(e,i),d=h.isHidden(e,o[0]);0<o.length&&!d?o[o.length-1].isLastNode=!0:0<o.length&&c.setLastNodeForHide(e,o)},setFirstNodeForHide:function(e,i){var o,d,t;for(d=0,t=i.length;d<t&&!(o=i[d]).isFirstNode;d++){if(!h.isHidden(e,o)&&!o.isFirstNode){o.isFirstNode=!0,c.setNodeLineIcos(e,o);break}o=null}return o},setFirstNodeForShow:function(e,i){var o,d,t,n,s;for(d=0,t=i.length;d<t;d++){o=i[d];var r=h.isHidden(e,o);if(!n&&!r&&o.isFirstNode){n=o;break}if(n||r||o.isFirstNode){if(n&&o.isFirstNode){o.isFirstNode=!1,s=o,c.setNodeLineIcos(e,o);break}o=null}else o.isFirstNode=!0,n=o,c.setNodeLineIcos(e,o)}return{new:n,old:s}},setLastNodeForHide:function(e,i){var o,d;for(d=i.length-1;0<=d&&!(o=i[d]).isLastNode;d--){if(!h.isHidden(e,o)&&!o.isLastNode){o.isLastNode=!0,c.setNodeLineIcos(e,o);break}o=null}return o},setLastNodeForShow:function(e,i){var o,d,t,n;for(d=i.length-1;0<=d;d--){o=i[d];var s=h.isHidden(e,o);if(!t&&!s&&o.isLastNode){t=o;break}if(t||s||o.isLastNode){if(t&&o.isLastNode){o.isLastNode=!1,n=o,c.setNodeLineIcos(e,o);break}o=null}else o.isLastNode=!0,t=o,c.setNodeLineIcos(e,o)}return{new:t,old:n}}},data:{initHideForExCheck:function(e,i){h.isHidden(e,i)&&e.check&&e.check.enable&&(void 0===i._nocheck&&(i._nocheck=!!i.nocheck,i.nocheck=!0),i.check_Child_State=-1,c.repairParentChkClassWithSelf&&c.repairParentChkClassWithSelf(e,i))},initShowForExCheck:function(e,i){if(!h.isHidden(e,i)&&e.check&&e.check.enable){if(void 0!==i._nocheck&&(i.nocheck=i._nocheck,delete i._nocheck),c.setChkClass){var o=d(i,n.id.CHECK,e);c.setChkClass(e,o,i)}c.repairParentChkClassWithSelf&&c.repairParentChkClassWithSelf(e,i)}}}};e.extend(!0,e.fn.zTree._z,i);var o=e.fn.zTree,t=o._z.tools,n=o.consts,c=o._z.view,h=o._z.data,d=(o._z.event,t.$);h.isHidden=function(e,i,o){if(!i)return!1;var d=e.data.key.isHidden;return void 0!==o?("string"==typeof o&&(o=t.eqs(o,"true")),o=!!o,i[d]=o):"string"==typeof i[d]?i[d]=t.eqs(i[d],"true"):i[d]=!!i[d],i[d]},h.exSetting({data:{key:{isHidden:"isHidden"}}}),h.addInitNode(function(e,i,o,d,t,n,s){var r=h.isHidden(e,o);h.isHidden(e,o,r),h.initHideForExCheck(e,o)}),h.addBeforeA(function(e,i,o){}),h.addZTreeTools(function(t,n){n.showNodes=function(e,i){c.showNodes(t,e,i)},n.showNode=function(e,i){e&&c.showNodes(t,[e],i)},n.hideNodes=function(e,i){c.hideNodes(t,e,i)},n.hideNode=function(e,i){e&&c.hideNodes(t,[e],i)};var s=n.checkNode;s&&(n.checkNode=function(e,i,o,d){e&&h.isHidden(t,e)||s.apply(n,arguments)})});var a=h.initNode;h.initNode=function(e,i,o,d,t,n,s){var r=(d||h.getRoot(e))[e.data.key.children];h.tmpHideFirstNode=c.setFirstNodeForHide(e,r),h.tmpHideLastNode=c.setLastNodeForHide(e,r),s&&(c.setNodeLineIcos(e,h.tmpHideFirstNode),c.setNodeLineIcos(e,h.tmpHideLastNode)),t=h.tmpHideFirstNode===o,n=h.tmpHideLastNode===o,a&&a.apply(h,arguments),s&&n&&c.clearOldLastNode(e,o,s)};var s=h.makeChkFlag;s&&(h.makeChkFlag=function(e,i){i&&h.isHidden(e,i)||s.apply(h,arguments)});var r=h.getTreeCheckedNodes;r&&(h.getTreeCheckedNodes=function(e,i,o,d){if(i&&0<i.length){var t=i[0].getParentNode();if(t&&h.isHidden(e,t))return[]}return r.apply(h,arguments)});var N=h.getTreeChangeCheckedNodes;N&&(h.getTreeChangeCheckedNodes=function(e,i,o){if(i&&0<i.length){var d=i[0].getParentNode();if(d&&h.isHidden(e,d))return[]}return N.apply(h,arguments)});var l=c.expandCollapseSonNode;l&&(c.expandCollapseSonNode=function(e,i,o,d,t){i&&h.isHidden(e,i)||l.apply(c,arguments)});var f=c.setSonNodeCheckBox;f&&(c.setSonNodeCheckBox=function(e,i,o,d){i&&h.isHidden(e,i)||f.apply(c,arguments)});var u=c.repairParentChkClassWithSelf;u&&(c.repairParentChkClassWithSelf=function(e,i){i&&h.isHidden(e,i)||u.apply(c,arguments)})}(jQuery);
\ No newline at end of file
......@@ -13,7 +13,7 @@
</font>
*2021.10.24* v3.5.47
*2021.10.24* v3.5.48
* fixed issue: moveNode will fixed the level className about childNodes;
* fixed issue: showNodeFocus should operate the A dom;
......
{
"name": "@ztree/ztree_v3",
"description": "zTree is a multi-functional 'tree plug-ins.' based on jQuery. The main advantages of zTree includes excellent performance, flexible configuration, and the combination of multiple functions.",
"version": "3.5.47",
"version": "3.5.48",
"homepage": "http://www.treejs.cn/v3/main.php",
"author": "zTree (https://github.com/zTree)",
"licenses": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册