Skip to content

Commit

Permalink
fixed issue: chkStyle="radio" and radioType="all", updateNode will ch…
Browse files Browse the repository at this point in the history
…ange the checked.
  • Loading branch information
ztree committed Jan 5, 2014
1 parent fbc2ae9 commit 1e8a144
Show file tree
Hide file tree
Showing 14 changed files with 145 additions and 137 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.16-beta.5
last verson : 3.5.16-beta.7


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

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

32 changes: 18 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 v3.5.16-beta.5
* JQuery zTree core v3.5.16-beta.7
* 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-12-29
* Date: 2014-01-05
*/
(function($){
var settings = {}, roots = {}, caches = {},
Expand Down Expand Up @@ -1678,7 +1678,7 @@
consts = zt.consts;
})(jQuery);
/*
* JQuery zTree excheck v3.5.16-beta.5
* JQuery zTree excheck v3.5.16-beta.7
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
Expand All @@ -1687,7 +1687,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: [email protected]
* Date: 2013-12-29
* Date: 2014-01-05
*/
(function($){
//default consts of excheck
Expand Down Expand Up @@ -2056,12 +2056,14 @@
if (setting.check.radioType == r.TYPE_ALL) {
for (i = checkedList.length-1; i >= 0; i--) {
pNode = checkedList[i];
pNode[checkedKey] = false;
checkedList.splice(i, 1);
if (pNode[checkedKey] && pNode != node) {
pNode[checkedKey] = false;
checkedList.splice(i, 1);

view.setChkClass(setting, $$(pNode, consts.id.CHECK, setting), pNode);
if (pNode.parentTId != node.parentTId) {
view.repairParentChkClassWithSelf(setting, pNode);
view.setChkClass(setting, $$(pNode, consts.id.CHECK, setting), pNode);
if (pNode.parentTId != node.parentTId) {
view.repairParentChkClassWithSelf(setting, pNode);
}
}
}
checkedList.push(node);
Expand Down Expand Up @@ -2305,7 +2307,7 @@
}
})(jQuery);
/*
* JQuery zTree exedit v3.5.16-beta.5
* JQuery zTree exedit v3.5.16-beta.7
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
Expand All @@ -2314,7 +2316,7 @@
* http://www.opensource.org/licenses/mit-license.php
*
* email: [email protected]
* Date: 2013-12-29
* Date: 2014-01-05
*/
(function($){
//default consts of exedit
Expand Down Expand Up @@ -2496,14 +2498,15 @@
zTreeTools.copyNode = function(targetNode, node, moveType, isSilent) {
if (!node) return null;
if (targetNode && !targetNode.isParent && this.setting.data.keep.leaf && moveType === consts.move.TYPE_INNER) return null;
var newNode = tools.clone(node);
var _this = this,
newNode = tools.clone(node);
if (!targetNode) {
targetNode = null;
moveType = consts.move.TYPE_INNER;
}
if (moveType == consts.move.TYPE_INNER) {
function copyCallback() {
view.addNodes(this.setting, targetNode, [newNode], isSilent);
view.addNodes(_this.setting, targetNode, [newNode], isSilent);
}

if (tools.canAsync(this.setting, targetNode)) {
Expand Down Expand Up @@ -2531,8 +2534,9 @@
} else if (!targetNode) {
targetNode = null;
}
var _this = this;
function moveCallback() {
view.moveNode(this.setting, targetNode, node, moveType, false, isSilent);
view.moveNode(_this.setting, targetNode, node, moveType, false, isSilent);
}
if (tools.canAsync(this.setting, targetNode) && moveType === consts.move.TYPE_INNER) {
view.asyncNode(this.setting, targetNode, isSilent, moveCallback);
Expand Down
Loading

0 comments on commit 1e8a144

Please sign in to comment.