Skip to content

Commit 00da6af

Browse files
committed
## v3.0.1
* Add `gulp`, `travis`,... * `dragBorder`: allow `drag` indent if `position` of `drag` >= `border` drag. * `for_all_descendants`: To access all descendant of node. * param: for_all_descendants(node, fnCallback); * return: false *(when `fnCallback` return `false` or `null`)*, true *(if accessed all descendant)* * fnCallback: to proccess when dir to node. * result: if return true or Object then `break` function `for_all_descendants` *(when function `for_all_descendants` return `false`)* * `for_all_ancestors`: sample like `for_all_descendants` *(but use to `ancestors`)*; * Attribute `tree-class` if `type`: * `string`: will cast value to `scope.tree_class` * `object`: will cast vaule to `$TreeDnDClass` * '$TreeDnDClass': constant of `class` in Tree, able `extend` by attribute `tree-class` * tree: 'tree-dnd', *(auto `addClass` tree-dnd)* * empty: 'tree-dnd-empty', * hidden: 'tree-dnd-hidden', * node: 'tree-dnd-node', *(auto `addClass` tree-dnd-node)* * nodes: 'tree-dnd-nodes', *(auto `addClass` tree-dnd-nodes)* * handle: 'tree-dnd-handle', * place: 'tree-dnd-placeholder', * drag: 'tree-dnd-drag', * status: 'tree-dnd-status', * icon: * '1': 'glyphicon glyphicon-minus', *(able cast by attribute `icon-leaf`)* * '0': 'glyphicon glyphicon-plus', *(able cast by attribute `icon-leaf`)* * '-1': 'glyphicon glyphicon-file', *(able cast by attribute `icon-leaf`)* * Attribute `tree-control` - Allow `developer` create new or overdrive all function exist below : * Directive: * collapse_all: () * collapse_node: (node) * expand_all: () * expand_all_parents: (child) * expand_node: (node) * select_first_node: () * select_next_node: (node) * select_next_sibling: (node) * select_node: (node) * deselect_node: () * select_parent_node: (node) * select_prev_node: (node) * select_prev_sibling: (node) * Event: * for_all_ancestors: (child, fn) * for_all_descendants: (node, fn) * get_children: (node) * get_closest_ancestor_next_sibling: (node) * get_first_child: (node) * get_first_node: () * get_last_descendant: (node) * get_next_node: (node) * get_next_sibling: (node) * get_parent: (node) * get_prev_node: (node) * get_prev_sibling: (node) * get_selected_node: () * get_siblings: (node) * Effect: * reload_data: () * add_node: (parent, new_node, index) * add_node_root: (new_node) * remove_node: (node) * selected_node: null
1 parent d8aa37a commit 00da6af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5755
-35210
lines changed

.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "demo/bower_components"
3+
}

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# OS generated files #
2+
######################
3+
.DS_Store
4+
.DS_Store?
5+
._*
6+
.Trashes
7+
ehthumbs.db
8+
Thumbs.db
9+
*.log
10+
11+
# Project dependencies #
12+
########################
13+
node_modules
14+
15+
# IDE files #
16+
.idea
17+
*.iml
18+
19+
demo/bower_components
20+
demo/source

.jshintrc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"bitwise": true,
3+
"immed": true,
4+
"newcap": true,
5+
"noarg": true,
6+
"noempty": true,
7+
"nonew": true,
8+
"trailing": true,
9+
"maxlen": 200,
10+
"boss": true,
11+
"eqnull": true,
12+
"expr": true,
13+
"laxbreak": true,
14+
"loopfunc": true,
15+
"sub": false,
16+
"undef": true,
17+
"curly": true,
18+
"browser": true,
19+
"indent": 4,
20+
"devel": true,
21+
"jquery": true,
22+
"globals": {
23+
"_": true,
24+
"angular": true,
25+
"module": true,
26+
"require": true,
27+
"IE": true,
28+
"beforeEach": true,
29+
"describe": true,
30+
"expect": true,
31+
"inject": true,
32+
"it": true
33+
},
34+
"noyield": true,
35+
"nonstandard": true,
36+
"funcscope": true,
37+
"validthis": true,
38+
"shadow": true,
39+
"iterator": true,
40+
"esnext": true,
41+
"forin": true,
42+
"white": true,
43+
"phantom": true,
44+
"smarttabs": true,
45+
"asi": true,
46+
"supernew": true,
47+
"eqeqeq": true,
48+
"moz": true,
49+
"undef": true,
50+
"evil": true,
51+
"scripturl": true,
52+
"debug": true,
53+
"laxcomma": true,
54+
"notypeof": true,
55+
"onevar": true,
56+
"worker": true,
57+
"lastsemic": true,
58+
"gcl": true,
59+
"nonbsp": true,
60+
"proto": true,
61+
"freeze": true,
62+
"multistr": true
63+
}

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: node_js
2+
node_js:
3+
- "0.10"
4+
5+
before_script:
6+
- npm install --quiet -g bower
7+
- npm install
8+
- bower install --force-latest
9+
10+
script:
11+
- npm test

CHANGELOG.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,71 @@
1+
## v3.0.1
2+
* Add `gulp`, `travis`,...
3+
* `dragBorder`: allow `drag` indent if `position` of `drag` >= `border` drag.
4+
* `for_all_descendants`: To access all descendant of node.
5+
* param: for_all_descendants(node, fnCallback);
6+
* return: false *(when `fnCallback` return `false` or `null`)*, true *(if accessed all descendant)*
7+
* fnCallback: to proccess when dir to node.
8+
* result: if return true or Object then `break` function `for_all_descendants` *(when function `for_all_descendants` return `false`)*
9+
* `for_all_ancestors`: sample like `for_all_descendants` *(but use to `ancestors`)*;
10+
11+
* Attribute `tree-class` if `type`:
12+
* `string`: will cast value to `scope.tree_class`
13+
* `object`: will cast vaule to `$TreeDnDClass`
14+
* '$TreeDnDClass': constant of `class` in Tree, able `extend` by attribute `tree-class`
15+
* tree: 'tree-dnd', *(auto `addClass` tree-dnd)*
16+
* empty: 'tree-dnd-empty',
17+
* hidden: 'tree-dnd-hidden',
18+
* node: 'tree-dnd-node', *(auto `addClass` tree-dnd-node)*
19+
* nodes: 'tree-dnd-nodes', *(auto `addClass` tree-dnd-nodes)*
20+
* handle: 'tree-dnd-handle',
21+
* place: 'tree-dnd-placeholder',
22+
* drag: 'tree-dnd-drag',
23+
* status: 'tree-dnd-status',
24+
* icon:
25+
* '1': 'glyphicon glyphicon-minus', *(able cast by attribute `icon-leaf`)*
26+
* '0': 'glyphicon glyphicon-plus', *(able cast by attribute `icon-leaf`)*
27+
* '-1': 'glyphicon glyphicon-file', *(able cast by attribute `icon-leaf`)*
28+
* Attribute `tree-control` - Allow `developer` create new or overdrive all function exist below :
29+
* Directive:
30+
* collapse_all: ()
31+
* collapse_node: (node)
32+
* expand_all: ()
33+
* expand_all_parents: (child)
34+
* expand_node: (node)
35+
* select_first_node: ()
36+
* select_next_node: (node)
37+
* select_next_sibling: (node)
38+
* select_node: (node)
39+
* deselect_node: ()
40+
* select_parent_node: (node)
41+
* select_prev_node: (node)
42+
* select_prev_sibling: (node)
43+
* Event:
44+
* for_all_ancestors: (child, fn)
45+
* for_all_descendants: (node, fn)
46+
* get_children: (node)
47+
* get_closest_ancestor_next_sibling: (node)
48+
* get_first_child: (node)
49+
* get_first_node: ()
50+
* get_last_descendant: (node)
51+
* get_next_node: (node)
52+
* get_next_sibling: (node)
53+
* get_parent: (node)
54+
* get_prev_node: (node)
55+
* get_prev_sibling: (node)
56+
* get_selected_node: ()
57+
* get_siblings: (node)
58+
* Effect:
59+
* reload_data: ()
60+
* add_node: (parent, new_node, index)
61+
* add_node_root: (new_node)
62+
* remove_node: (node)
63+
* selected_node: null
64+
165
## v3.0.0
266
* Renamed
367
* module `treeTable` to `ntt.TreeDnD`
4-
* `angular-tree-table` to `angular-tree-dnd`:
68+
* `angular-tree-table` to `ng-tree-dnd`:
569
* `tree-table` to `tree-dnd`.
670
* `tree-table-node` to `tree-dnd-node`.
771
* `tree-table-nodes` to `tree-dnd-nodes`.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
## Current Version
66
[![GitHub version](https://badge.fury.io/gh/thienhung1989%2Fangular-tree-dnd.svg)](http://badge.fury.io/gh/thienhung1989%2Fangular-tree-dnd)
77

8+
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/thienhung1989/ng-tree-dnd?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
89
## Demo:
910
- http://thienhung1989.github.io/angular-tree-dnd/demo
1011
- http://plnkr.co/edit/6zQNvW?p=preview

bower.json

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,51 @@
11
{
2-
"name": "angular-tree-dnd",
3-
"version": "3.0.0",
4-
"description":"Display tree table (or list) & event DrapnDrop (allow drag multi tree-dnd include all type: table, ol, ul) by AngularJS, using CSS animation and Bootstrap style",
5-
"main":[
6-
"src/ng-tree-dnd.css",
7-
"src/ng-tree-dnd.js",
8-
"src/ng-tree-dnd.min.css",
9-
"src/ng-tree-dnd.min.js"
10-
],
11-
"licence":"MIT",
12-
"keywords":["angularjs","bootstrap", "tree", "grid","widget", "table", "dnd"],
13-
"authors":["Nguyen Thien Hung"],
14-
"homepage" :"https://github.com/thienhung1989/angular-tree-dnd",
15-
"repository":{
16-
"type":"git",
17-
"url":"git://github.com/thienhung1989/angular-tree-dnd"
18-
},
19-
"ignore": [
20-
"temp",
21-
"test",
22-
".gitignore",
23-
"bower.json",
24-
"package.json",
25-
"README.md"
26-
],
27-
"dependencies": {
28-
"angular": ">=1.2"
29-
}
2+
"name": "ng-tree-dnd",
3+
"version": "3.0.1",
4+
"authors": ["Nguyen Thien Hung"],
5+
"homepage": "https://github.com/thienhung1989/ng-tree-dnd",
6+
"description": "Display tree table (or list) & event DrapnDrop (allow drag multi tree-dnd include all type: table, ol, ul) by AngularJS, using CSS animation and Bootstrap style",
7+
"main": [
8+
"dist/ng-tree-dnd.css",
9+
"dist/ng-tree-dnd.js",
10+
"dist/ng-tree-dnd.min.css",
11+
"dist/ng-tree-dnd.min.js"
12+
],
13+
"licence": "MIT",
14+
"keywords": [
15+
"angularjs",
16+
"bootstrap",
17+
"tree",
18+
"grid",
19+
"widget",
20+
"table",
21+
"dnd"
22+
],
23+
"repository": {
24+
"type": "git",
25+
"url": "git://github.com/thienhung1989/ng-tree-dnd"
26+
},
27+
"ignore": [
28+
"temp",
29+
"test",
30+
".gitignore",
31+
"examples",
32+
"demo",
33+
"build",
34+
"guide",
35+
"node_modules",
36+
"source",
37+
"tasks",
38+
"tests",
39+
"gulpfile.js",
40+
"karma.conf.js"
41+
],
42+
"dependencies": {
43+
"angular": ">=1.2"
44+
},
45+
"devDependencies": {
46+
"angular-mocks": ">= 1.2.0",
47+
"angular-route": ">= 1.2.0",
48+
"angularfire": "~0.8.2",
49+
"bootstrap-css": ">=3.2.0"
50+
}
3051
}

demo/basic/basic-frame.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<div class="row">
2+
<div class="col-xs-3">
3+
<ul basic-toolbars class="btn-group-vertical btn-sm">
4+
<li ng-repeat="toolbar in toolbars"
5+
ng-disabled="!toolbar.click"
6+
ng-click="!toolbar.click ? (false) : (toolbar.log) ? (log = getFn(toolbar.click)()) : getFn(toolbar.click)()"
7+
ng-class="toolbar.class || 'btn btn-success btn-sm'">
8+
{{ toolbar.click || toolbar.label }}
9+
<i ng-if="toolbar.log">(*)</i>
10+
</li>
11+
</ul>
12+
</div>
13+
<div class="col-xs-9" ng-include="'basic/basic.html'"></div>
14+
</div>
15+
16+
<div class="row">
17+
<div class="col-xs-7" view-source="basic"></div>
18+
19+
<div class="col-xs-5">
20+
<h2>Generated Model</h2>
21+
<pre class="code">{{ tree_data | json }}</pre>
22+
</div>
23+
</div>

demo/basic/basic-toolbar.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
(function () {
3+
'use strict';
4+
app.directive(
5+
'basicToolbars', function () {
6+
return {
7+
restrict: 'A',
8+
replace: true,
9+
link: function (scope, element, attrs) {
10+
// debug in demo
11+
scope.getFn = function(name){
12+
return scope.my_tree[name];
13+
}
14+
15+
scope.toolbars = [
16+
{
17+
class: 'btn btn-warning',
18+
label: '----- Effect -----'
19+
},
20+
{click: 'reload_data'},
21+
{click: 'remove_node'},
22+
{label: 'add_node'},
23+
{label: 'add_node_root'},
24+
{
25+
class: 'btn btn-warning',
26+
label: '----- Directive -----'
27+
},
28+
{click: 'expand_all'},
29+
{click: 'collapse_all'},
30+
{click: 'expand_node'},
31+
{click: 'collapse_node'},
32+
{label: 'expand_all_parents'},
33+
{click: 'select_first_node', log: true},
34+
{click: 'select_next_node', log: true},
35+
{click: 'select_prev_node', log: true},
36+
{click: 'select_next_sibling', log: true},
37+
{click: 'select_prev_sibling', log: true},
38+
{click: 'select_parent_node', log: true},
39+
{click: 'select_node', log: true},
40+
{click: 'deselect_node', log: true},
41+
{
42+
class: 'btn btn-warning',
43+
label: '----- Event -----'
44+
},
45+
{click: 'get_children', log: true},
46+
{click: 'get_closest_ancestor_next_sibling', log: true},
47+
{click: 'get_first_child', log: true},
48+
{click: 'get_first_node', log: true},
49+
{click: 'get_last_descendant', log: true},
50+
{click: 'get_next_node', log: true},
51+
{click: 'get_next_sibling', log: true},
52+
{click: 'get_parent', log: true},
53+
{click: 'get_prev_node', log: true},
54+
{click: 'get_prev_sibling', log: true},
55+
{click: 'get_selected_node', log: true},
56+
{click: 'get_siblings', log: true},
57+
];
58+
}
59+
}
60+
}
61+
);
62+
})();

demo/basic/basic.css

Whitespace-only changes.

0 commit comments

Comments
 (0)