Skip to content

Commit

Permalink
fix issue about : drag-drop node will throw error, if the page has if…
Browse files Browse the repository at this point in the history
…rame.

fix issue about : after remove all the child nodes, you use addNodes() method to add node to the parent node, you will can't see the node's DOM
  • Loading branch information
zTree committed Jun 12, 2013
1 parent 03c4f8f commit bbc9e06
Show file tree
Hide file tree
Showing 13 changed files with 151 additions and 143 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
jQuery Tree Plugin ---- zTree
============
last verson : 3.5.13
last verson : 3.5.14-beta.1


**Donate to zTree** : http://www.ztree.me/v3/donate.php
Expand Down
38 changes: 19 additions & 19 deletions api/apiCss/jquery.ztree.core-3.5.js

Large diffs are not rendered by default.

31 changes: 17 additions & 14 deletions js/jquery.ztree.all-3.5.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/*
* JQuery zTree core 3.5.13
* JQuery zTree core 3.5.14-beta.1
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
Expand All @@ -9,7 +9,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: [email protected]
* Date: 2013-06-02
* Date: 2013-06-12
*/
(function($){
var settings = {}, roots = {}, caches = {},
Expand Down Expand Up @@ -875,12 +875,13 @@
nObj = $$(node, setting);
}
var ulObj = $$(node, consts.id.UL, setting);
if (!ulObj.get(0)) {
var childKey = setting.data.key.children,
childHtml = view.appendNodes(setting, node.level+1, node[childKey], node, false, true);
view.makeUlHtml(setting, node, html, childHtml.join(''));
nObj.append(html.join(''));
if (ulObj.get(0)) {
ulObj.remove();
}
var childKey = setting.data.key.children,
childHtml = view.appendNodes(setting, node.level+1, node[childKey], node, false, true);
view.makeUlHtml(setting, node, html, childHtml.join(''));
nObj.append(html.join(''));
},
asyncNode: function(setting, node, isSilent, callback) {
var i, l;
Expand Down Expand Up @@ -1671,7 +1672,7 @@
consts = zt.consts;
})(jQuery);
/*
* JQuery zTree excheck 3.5.13
* JQuery zTree excheck 3.5.14-beta.1
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
Expand All @@ -1680,7 +1681,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: [email protected]
* Date: 2013-06-02
* Date: 2013-06-12
*/
(function($){
//default consts of excheck
Expand Down Expand Up @@ -2297,7 +2298,7 @@
}
})(jQuery);
/*
* JQuery zTree exedit 3.5.13
* JQuery zTree exedit 3.5.14-beta.1
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
Expand All @@ -2306,7 +2307,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: [email protected]
* Date: 2013-06-02
* Date: 2013-06-12
*/
(function($){
//default consts of exedit
Expand Down Expand Up @@ -3018,8 +3019,10 @@
//method of tools for zTree
_tools = {
getAbs: function (obj) {
var oRect = obj.getBoundingClientRect();
return [oRect.left,oRect.top]
var oRect = obj.getBoundingClientRect(),
scrollTop = document.body.scrollTop+document.documentElement.scrollTop,
scrollLeft = document.body.scrollLeft+document.documentElement.scrollLeft;
return [oRect.left+scrollLeft,oRect.top+scrollTop];
},
inputFocus: function(inputObj) {
if (inputObj.get(0)) {
Expand Down Expand Up @@ -3059,7 +3062,7 @@
var obj = iframeList.get(i),
r = tools.getAbs(obj),
dragMask = $$("<div id='zTreeMask_" + i + "' class='zTreeMask' style='top:" + r[1] + "px; left:" + r[0] + "px; width:" + obj.offsetWidth + "px; height:" + obj.offsetHeight + "px;'></div>", setting);
dragMask.appendTo(body);
dragMask.appendTo($$("body", setting));
root.dragMaskList.push(dragMask);
}
}
Expand Down
90 changes: 45 additions & 45 deletions js/jquery.ztree.all-3.5.min.js

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions js/jquery.ztree.core-3.5.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* JQuery zTree core 3.5.13
* JQuery zTree core 3.5.14-beta.1
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
Expand All @@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: [email protected]
* Date: 2013-06-02
* Date: 2013-06-12
*/
(function($){
var settings = {}, roots = {}, caches = {},
Expand Down Expand Up @@ -874,12 +874,13 @@
nObj = $$(node, setting);
}
var ulObj = $$(node, consts.id.UL, setting);
if (!ulObj.get(0)) {
var childKey = setting.data.key.children,
childHtml = view.appendNodes(setting, node.level+1, node[childKey], node, false, true);
view.makeUlHtml(setting, node, html, childHtml.join(''));
nObj.append(html.join(''));
if (ulObj.get(0)) {
ulObj.remove();
}
var childKey = setting.data.key.children,
childHtml = view.appendNodes(setting, node.level+1, node[childKey], node, false, true);
view.makeUlHtml(setting, node, html, childHtml.join(''));
nObj.append(html.join(''));
},
asyncNode: function(setting, node, isSilent, callback) {
var i, l;
Expand Down
38 changes: 19 additions & 19 deletions js/jquery.ztree.core-3.5.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/jquery.ztree.excheck-3.5.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* JQuery zTree excheck 3.5.13
* JQuery zTree excheck 3.5.14-beta.1
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
Expand All @@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: [email protected]
* Date: 2013-06-02
* Date: 2013-06-12
*/
(function($){
//default consts of excheck
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.ztree.excheck-3.5.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions js/jquery.ztree.exedit-3.5.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* JQuery zTree exedit 3.5.13
* JQuery zTree exedit 3.5.14-beta.1
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
Expand All @@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: [email protected]
* Date: 2013-06-02
* Date: 2013-06-12
*/
(function($){
//default consts of exedit
Expand Down Expand Up @@ -720,8 +720,10 @@
//method of tools for zTree
_tools = {
getAbs: function (obj) {
var oRect = obj.getBoundingClientRect();
return [oRect.left,oRect.top]
var oRect = obj.getBoundingClientRect(),
scrollTop = document.body.scrollTop+document.documentElement.scrollTop,
scrollLeft = document.body.scrollLeft+document.documentElement.scrollLeft;
return [oRect.left+scrollLeft,oRect.top+scrollTop];
},
inputFocus: function(inputObj) {
if (inputObj.get(0)) {
Expand Down Expand Up @@ -761,7 +763,7 @@
var obj = iframeList.get(i),
r = tools.getAbs(obj),
dragMask = $$("<div id='zTreeMask_" + i + "' class='zTreeMask' style='top:" + r[1] + "px; left:" + r[0] + "px; width:" + obj.offsetWidth + "px; height:" + obj.offsetHeight + "px;'></div>", setting);
dragMask.appendTo(body);
dragMask.appendTo($$("body", setting));
root.dragMaskList.push(dragMask);
}
}
Expand Down
Loading

0 comments on commit bbc9e06

Please sign in to comment.