提交 2c77ffee 编写于 作者: Z ztree

【修改】增加 <a> 的 padding 后, 导致 setting.edit.drag.inner 无效

上级 26489d00
jQuery Tree Plugin ---- zTree
============
last verson : 3.5.21
last verson : 3.5.22
**Donate to zTree** : http://www.ztree.me/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.21 API 文档</em></h1><p></p>
<h1><em>zTree v3.5.22 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.21 API Document</em></h1><p></p>
<h1><em>zTree v3.5.22 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;">
......
/*
* JQuery zTree core v3.5.21
* JQuery zTree core v3.5.22
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
......@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-02-17
* Date: 2016-03-01
*/
(function(q){var H,I,J,K,L,M,u,r={},v={},w={},N={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url",icon:"icon"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text",
url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},x=[function(b){var a=b.treeObj,c=f.event;a.bind(c.NODECREATED,function(a,c,g){j.apply(b.callback.onNodeCreated,
......
/*
* JQuery zTree core v3.5.21
* JQuery zTree core v3.5.22
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
......@@ -9,7 +9,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-02-17
* Date: 2016-03-01
*/
(function($){
var settings = {}, roots = {}, caches = {},
......@@ -1814,7 +1814,7 @@
consts = zt.consts;
})(jQuery);
/*
* JQuery zTree excheck v3.5.21
* JQuery zTree excheck v3.5.22
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
......@@ -1823,7 +1823,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-02-17
* Date: 2016-03-01
*/
(function($){
//default consts of excheck
......@@ -2442,7 +2442,7 @@
}
})(jQuery);
/*
* JQuery zTree exedit v3.5.21
* JQuery zTree exedit v3.5.22
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
......@@ -2451,7 +2451,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-02-17
* Date: 2016-03-01
*/
(function($){
//default consts of exedit
......@@ -2958,7 +2958,8 @@
canPrev = (isCopy || !isNext) && tools.apply(targetSetting.edit.drag.prev, [targetSetting.treeId, nodes, tmpTargetNode], !!targetSetting.edit.drag.prev),
canNext = (isCopy || !isPrev) && tools.apply(targetSetting.edit.drag.next, [targetSetting.treeId, nodes, tmpTargetNode], !!targetSetting.edit.drag.next),
canInner = (isCopy || !isInner) && !(targetSetting.data.keep.leaf && !tmpTargetNode.isParent) && tools.apply(targetSetting.edit.drag.inner, [targetSetting.treeId, nodes, tmpTargetNode], !!targetSetting.edit.drag.inner);
if (!canPrev && !canNext && !canInner) {
function clearMove() {
tmpTarget = null;
tmpTargetNodeId = "";
moveType = consts.move.TYPE_INNER;
......@@ -2969,6 +2970,9 @@
clearTimeout(window.zTreeMoveTimer);
window.zTreeMoveTargetNodeTId = null
}
}
if (!canPrev && !canNext && !canInner) {
clearMove();
} else {
var tmpTargetA = $("#" + tmpTargetNodeId + consts.id.A, tmpTarget),
tmpNextA = tmpTargetNode.isLastNode ? null : $("#" + tmpTargetNode.getNextNode().tId + consts.id.A, tmpTarget.next()),
......@@ -2977,7 +2981,8 @@
prevPercent = canPrev ? (canInner ? 0.25 : (canNext ? 0.5 : 1) ) : -1,
nextPercent = canNext ? (canInner ? 0.75 : (canPrev ? 0.5 : 0) ) : -1,
dY_percent = (event.clientY + docScrollTop - tmpTop)/tmpTargetA.height();
if ((prevPercent==1 ||dY_percent<=prevPercent && dY_percent>=-.2) && canPrev) {
if ((prevPercent==1 || dY_percent<=prevPercent && dY_percent>=-.2) && canPrev) {
dX = 1 - tmpArrow.width();
dY = tmpTop - tmpArrow.height()/2;
moveType = consts.move.TYPE_PREV;
......@@ -2985,11 +2990,15 @@
dX = 1 - tmpArrow.width();
dY = (tmpNextA == null || (tmpTargetNode.isParent && tmpTargetNode.open)) ? (tmpTop + tmpTargetA.height() - tmpArrow.height()/2) : (tmpNextA.offset().top - tmpArrow.height()/2);
moveType = consts.move.TYPE_NEXT;
}else {
} else if (canInner) {
dX = 5 - tmpArrow.width();
dY = tmpTop;
moveType = consts.move.TYPE_INNER;
} else {
clearMove();
}
if (tmpTarget) {
tmpArrow.css({
"display":"block",
"top": dY + "px",
......@@ -3005,7 +3014,7 @@
if (window.zTreeMoveTimer && window.zTreeMoveTargetNodeTId !== tmpTargetNode.tId) {
clearTimeout(window.zTreeMoveTimer);
window.zTreeMoveTargetNodeTId = null;
}else if (window.zTreeMoveTimer && window.zTreeMoveTargetNodeTId === tmpTargetNode.tId) {
} else if (window.zTreeMoveTimer && window.zTreeMoveTargetNodeTId === tmpTargetNode.tId) {
startTimer = false;
}
if (startTimer) {
......@@ -3023,6 +3032,7 @@
}
}
}
}
} else {
moveType = consts.move.TYPE_INNER;
if (tmpTarget && tools.apply(targetSetting.edit.drag.inner, [targetSetting.treeId, nodes, null], !!targetSetting.edit.drag.inner)) {
......
此差异已折叠。
/*
* JQuery zTree core v3.5.21
* JQuery zTree core v3.5.22
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
......@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-02-17
* Date: 2016-03-01
*/
(function($){
var settings = {}, roots = {}, caches = {},
......
/*
* JQuery zTree core v3.5.21
* JQuery zTree core v3.5.22
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
......@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-02-17
* Date: 2016-03-01
*/
(function(q){var H,I,J,K,L,M,u,r={},v={},w={},N={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url",icon:"icon"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text",
url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},x=[function(b){var a=b.treeObj,c=f.event;a.bind(c.NODECREATED,function(a,c,g){j.apply(b.callback.onNodeCreated,
......
/*
* JQuery zTree excheck v3.5.21
* JQuery zTree excheck v3.5.22
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
......@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-02-17
* Date: 2016-03-01
*/
(function($){
//default consts of excheck
......
/*
* JQuery zTree excheck v3.5.21
* JQuery zTree excheck v3.5.22
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
......@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-02-17
* Date: 2016-03-01
*/
(function(m){var p,q,r,o={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"}},v={check:{enable:!1,autoCheckTrigger:!1,chkStyle:o.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:o.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}};p=function(c,
a){if(a.chkDisabled===!0)return!1;var b=g.getSetting(c.data.treeId),d=b.data.key.checked;if(k.apply(b.callback.beforeCheck,[b.treeId,a],!0)==!1)return!0;a[d]=!a[d];e.checkNodeRelation(b,a);d=n(a,j.id.CHECK,b);e.setChkClass(b,d,a);e.repairParentChkClassWithSelf(b,a);b.treeObj.trigger(j.event.CHECK,[c,b.treeId,a]);return!0};q=function(c,a){if(a.chkDisabled===!0)return!1;var b=g.getSetting(c.data.treeId),d=n(a,j.id.CHECK,b);a.check_Focus=!0;e.setChkClass(b,d,a);return!0};r=function(c,a){if(a.chkDisabled===
......
/*
* JQuery zTree exedit v3.5.21
* JQuery zTree exedit v3.5.22
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
......@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-02-17
* Date: 2016-03-01
*/
(function($){
//default consts of exedit
......@@ -515,7 +515,8 @@
canPrev = (isCopy || !isNext) && tools.apply(targetSetting.edit.drag.prev, [targetSetting.treeId, nodes, tmpTargetNode], !!targetSetting.edit.drag.prev),
canNext = (isCopy || !isPrev) && tools.apply(targetSetting.edit.drag.next, [targetSetting.treeId, nodes, tmpTargetNode], !!targetSetting.edit.drag.next),
canInner = (isCopy || !isInner) && !(targetSetting.data.keep.leaf && !tmpTargetNode.isParent) && tools.apply(targetSetting.edit.drag.inner, [targetSetting.treeId, nodes, tmpTargetNode], !!targetSetting.edit.drag.inner);
if (!canPrev && !canNext && !canInner) {
function clearMove() {
tmpTarget = null;
tmpTargetNodeId = "";
moveType = consts.move.TYPE_INNER;
......@@ -526,6 +527,9 @@
clearTimeout(window.zTreeMoveTimer);
window.zTreeMoveTargetNodeTId = null
}
}
if (!canPrev && !canNext && !canInner) {
clearMove();
} else {
var tmpTargetA = $("#" + tmpTargetNodeId + consts.id.A, tmpTarget),
tmpNextA = tmpTargetNode.isLastNode ? null : $("#" + tmpTargetNode.getNextNode().tId + consts.id.A, tmpTarget.next()),
......@@ -534,7 +538,8 @@
prevPercent = canPrev ? (canInner ? 0.25 : (canNext ? 0.5 : 1) ) : -1,
nextPercent = canNext ? (canInner ? 0.75 : (canPrev ? 0.5 : 0) ) : -1,
dY_percent = (event.clientY + docScrollTop - tmpTop)/tmpTargetA.height();
if ((prevPercent==1 ||dY_percent<=prevPercent && dY_percent>=-.2) && canPrev) {
if ((prevPercent==1 || dY_percent<=prevPercent && dY_percent>=-.2) && canPrev) {
dX = 1 - tmpArrow.width();
dY = tmpTop - tmpArrow.height()/2;
moveType = consts.move.TYPE_PREV;
......@@ -542,11 +547,15 @@
dX = 1 - tmpArrow.width();
dY = (tmpNextA == null || (tmpTargetNode.isParent && tmpTargetNode.open)) ? (tmpTop + tmpTargetA.height() - tmpArrow.height()/2) : (tmpNextA.offset().top - tmpArrow.height()/2);
moveType = consts.move.TYPE_NEXT;
}else {
} else if (canInner) {
dX = 5 - tmpArrow.width();
dY = tmpTop;
moveType = consts.move.TYPE_INNER;
} else {
clearMove();
}
if (tmpTarget) {
tmpArrow.css({
"display":"block",
"top": dY + "px",
......@@ -562,7 +571,7 @@
if (window.zTreeMoveTimer && window.zTreeMoveTargetNodeTId !== tmpTargetNode.tId) {
clearTimeout(window.zTreeMoveTimer);
window.zTreeMoveTargetNodeTId = null;
}else if (window.zTreeMoveTimer && window.zTreeMoveTargetNodeTId === tmpTargetNode.tId) {
} else if (window.zTreeMoveTimer && window.zTreeMoveTargetNodeTId === tmpTargetNode.tId) {
startTimer = false;
}
if (startTimer) {
......@@ -580,6 +589,7 @@
}
}
}
}
} else {
moveType = consts.move.TYPE_INNER;
if (tmpTarget && tools.apply(targetSetting.edit.drag.inner, [targetSetting.treeId, nodes, null], !!targetSetting.edit.drag.inner)) {
......
此差异已折叠。
/*
* JQuery zTree exHideNodes v3.5.21
* JQuery zTree exHideNodes v3.5.22
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
......@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-02-17
* Date: 2016-03-01
*/
(function($){
//default init node of exLib
......
/*
* JQuery zTree exHideNodes v3.5.21
* JQuery zTree exHideNodes v3.5.22
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
......@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2016-02-17
* Date: 2016-03-01
*/
(function(i){i.extend(!0,i.fn.zTree._z,{view:{clearOldFirstNode:function(c,a){for(var b=a.getNextNode();b;){if(b.isFirstNode){b.isFirstNode=!1;d.setNodeLineIcos(c,b);break}if(b.isLastNode)break;b=b.getNextNode()}},clearOldLastNode:function(c,a,b){for(a=a.getPreNode();a;){if(a.isLastNode){a.isLastNode=!1;b&&d.setNodeLineIcos(c,a);break}if(a.isFirstNode)break;a=a.getPreNode()}},makeDOMNodeMainBefore:function(c,a,b){c.push("<li ",b.isHidden?"style='display:none;' ":"","id='",b.tId,"' class='",l.className.LEVEL,
b.level,"' tabindex='0' hidefocus='true' treenode>")},showNode:function(c,a){a.isHidden=!1;f.initShowForExCheck(c,a);j(a,c).show()},showNodes:function(c,a,b){if(a&&a.length!=0){var e={},g,k;for(g=0,k=a.length;g<k;g++){var h=a[g];if(!e[h.parentTId]){var i=h.getParentNode();e[h.parentTId]=i===null?f.getRoot(c):h.getParentNode()}d.showNode(c,h,b)}for(var j in e)a=e[j][c.data.key.children],d.setFirstNodeForShow(c,a),d.setLastNodeForShow(c,a)}},hideNode:function(c,a){a.isHidden=!0;a.isFirstNode=!1;a.isLastNode=
......
......@@ -14,8 +14,9 @@
</font>
*2016.03.01* v3.5.21
*2016.03.01* v3.5.22
* 【修改】metro Demo 的样式错误
* 【修改】增加 <a> 的 padding 后, 导致 setting.edit.drag.inner 无效
*2016.02.17* v3.5.21
* 【修改】zTree js 文件名 (为了便于发布到 https://cdnjs.com/)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册