Skip to content

Commit 12913f7

Browse files
committed
fixed the bug where the tree node changed level on a lower level and the DOM was not updated correctly
small change to the options.sortValid - sortable extension - for the text message in the tooltip when in drag
1 parent e35dada commit 12913f7

17 files changed

+38
-30
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ $(function(){
4040

4141
});
4242

43-
aciTree jQuery Plugin v4.5.0-rc.5
43+
aciTree jQuery Plugin v4.5.0-rc.6
4444
http://acoderinsights.ro
4545

4646
Copyright (c) 2014 Dragos Ursu

aciTree.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ <h2>Available aciTree treeview demos</h2>
5959
<li>aciTree treeview client-side <a href="/demo/aciTree-filter-search.html" target="_blank" title="aciTree treeview filter & search">filter & search</a></li>
6060
<li>aciTree treeview and <a href="/demo/aciTree-full-size.html" target="_blank" title="aciTree treeview full size">full window width</a></li>
6161

62-
<li>(<span style="color:red">new</span>) aciTree treeview with a <a href="/demo/aciTree-context-menu.html" target="_blank" title="aciTree treeview context menu">context menu</a></li>
62+
<li>aciTree treeview with a <a href="/demo/aciTree-context-menu.html" target="_blank" title="aciTree treeview context menu">context menu</a></li>
63+
64+
<li>(<span style="color:red">new</span>) aciTree treeview <a href="/aciTreeEditor/index.html" target="_blank" title="aciTree treeview Editor">editor</a></li>
6365
</ul>
6466

6567
<p>Note: in the demo below - the node loading it's made with a delay so you can see the loading animation.

aciTree.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"ui",
99
"ajax"
1010
],
11-
"version": "4.5.0-rc.5",
11+
"version": "4.5.0-rc.6",
1212
"author": {
1313
"name": "Dragos Ursu",
1414
"email":"dragosu@acoderinsights.ro",

documentation.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5-
<title>aciTree v4.5.0-rc.5 - A javascript treeview control with jQuery</title>
5+
<title>aciTree v4.5.0-rc.6 - A javascript treeview control with jQuery</title>
66
<meta name="description" content="aciTree javascript treeview API documentation">
77
<style type="text/css">
88
html {
@@ -146,7 +146,7 @@
146146
</head>
147147

148148
<body>
149-
<h1>aciTree API v4.5.0-rc.5</h1>
149+
<h1>aciTree API v4.5.0-rc.6</h1>
150150

151151
<p>
152152
Please note: here are listed only the public API methods, you need to
@@ -1683,7 +1683,7 @@ <h1>aciTree API v4.5.0-rc.5</h1>
16831683

16841684
</div>
16851685

1686-
<p>aciTree jQuery Plugin v4.5.0-rc.5</p>
1686+
<p>aciTree jQuery Plugin v4.5.0-rc.6</p>
16871687
<p>http://acoderinsights.ro</p>
16881688

16891689
<p>Copyright (c) 2014 Dragos Ursu</p>

js/jquery.aciTree.checkbox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu

js/jquery.aciTree.column.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu

js/jquery.aciTree.core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu

js/jquery.aciTree.debug.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu

js/jquery.aciTree.dom.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu

js/jquery.aciTree.editable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu

js/jquery.aciTree.hash.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu

js/jquery.aciTree.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery.aciTree.persist.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu

js/jquery.aciTree.radio.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu

js/jquery.aciTree.selectable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu

js/jquery.aciTree.sortable.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu
@@ -30,15 +30,19 @@
3030
},
3131
// called by the `aciSortable` inside the `valid` callback
3232
sortValid: function(item, hover, before, isContainer, placeholder, helper) {
33+
var move = this.getLabel(item);
34+
if (this._private.dragDrop.length > 1) {
35+
move += ' and #' + (this._private.dragDrop.length - 1) + ' more';
36+
}
3337
if (isContainer) {
34-
helper.html('move ' + this.getLabel(item) + ' to ' + this.getLabel(this.itemFrom(hover)));
38+
helper.html('move ' + move + ' to ' + this.getLabel(this.itemFrom(hover)));
3539
placeholder.removeClass('aciTreeAfter aciTreeBefore');
3640
} else if (before !== null) {
3741
if (before) {
38-
helper.html('move ' + this.getLabel(item) + ' before ' + this.getLabel(hover));
42+
helper.html('move ' + move + ' before ' + this.getLabel(hover));
3943
placeholder.removeClass('aciTreeAfter').addClass('aciTreeBefore');
4044
} else {
41-
helper.html('move ' + this.getLabel(item) + ' after ' + this.getLabel(hover));
45+
helper.html('move ' + move + ' after ' + this.getLabel(hover));
4246
placeholder.removeClass('aciTreeBefore').addClass('aciTreeAfter');
4347
}
4448
}

js/jquery.aciTree.utils.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* aciTree jQuery Plugin v4.5.0-rc.5
3+
* aciTree jQuery Plugin v4.5.0-rc.6
44
* http://acoderinsights.ro
55
*
66
* Copyright (c) 2014 Dragos Ursu
@@ -153,19 +153,21 @@
153153
}
154154
line.appendChild(entry);
155155
} else {
156-
line.removeChild(line.firstChild);
157-
line.appendChild(entry);
156+
var branch = entry;
157+
for (var i = toLevel; i <= fromLevel; i++) {
158+
branch = branch.parentNode;
159+
}
160+
branch.removeChild(branch.firstChild);
161+
branch.appendChild(entry);
158162
}
159163
},
160164
// update child level
161165
_updateChildLevel: function(item, fromLevel, toLevel) {
162-
this.children(item).each(this.proxy(function(element) {
166+
this.children(item, false, true).each(this.proxy(function(element) {
163167
var item = $(element);
164168
this._updateItemLevel(item, fromLevel, toLevel);
165169
if (this.isInode(item)) {
166-
this.children(item).each(this.proxy(function(element) {
167-
this._updateChildLevel($(element), fromLevel + 1, toLevel + 1);
168-
}, true));
170+
this._updateChildLevel(item, fromLevel + 1, toLevel + 1);
169171
}
170172
}, true));
171173
},

0 commit comments

Comments
 (0)