jqtree 1.6.0 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +3 -11
- package/.github/workflows/ci.yml +48 -23
- package/.github/workflows/codeql-analysis.yml +9 -5
- package/.prettier +3 -0
- package/README.md +11 -8
- package/bower.json +1 -1
- package/{.postcssrc → config/.postcssrc} +0 -0
- package/config/babel.config.json +11 -0
- package/config/babel.coverage.config.json +4 -0
- package/{jest-jsdom.config.js → config/jest.config.js} +9 -5
- package/config/playwright.config.js +18 -0
- package/config/production +4 -0
- package/{rollup.config.js → config/rollup.config.js} +19 -14
- package/{jqtree.postcss → css/jqtree.postcss} +3 -0
- package/devserver/index.html +1 -9
- package/docs/Gemfile +2 -0
- package/docs/Gemfile.lock +263 -0
- package/{_config.yml → docs/_config.yml} +8 -1
- package/{_entries → docs/_entries}/01_general.md +0 -0
- package/{_entries → docs/_entries}/02_introduction.md +0 -0
- package/{_entries → docs/_entries}/03_features.md +1 -1
- package/{_entries → docs/_entries}/04_demo.html +1 -7
- package/{_entries → docs/_entries}/05_requirements.md +0 -0
- package/{_entries → docs/_entries}/06_downloads.md +0 -0
- package/{_entries → docs/_entries}/07_tutorial.md +0 -0
- package/{_entries → docs/_entries}/08_examples.md +0 -0
- package/{_entries → docs/_entries}/09_usecases.md +0 -0
- package/{_entries → docs/_entries}/10_changelog.md +14 -0
- package/{_entries → docs/_entries}/11_options.md +0 -0
- package/{_entries → docs/_entries}/12_animationspeed.md +0 -0
- package/{_entries → docs/_entries}/13_autoescape.md +0 -0
- package/{_entries → docs/_entries}/14_autoopen.md +0 -0
- package/{_entries → docs/_entries}/15_buttonleft.md +0 -0
- package/{_entries → docs/_entries}/16_closedicon.md +0 -0
- package/{_entries → docs/_entries}/17_data.md +0 -0
- package/{_entries → docs/_entries}/18_datafilter.md +0 -0
- package/{_entries → docs/_entries}/19_data-url.md +0 -0
- package/{_entries → docs/_entries}/20_draganddrop.md +0 -0
- package/{_entries → docs/_entries}/21_keyboardsupport.md +0 -0
- package/{_entries → docs/_entries}/22_oncanmove.md +0 -0
- package/{_entries → docs/_entries}/23_oncanmoveto.md +2 -2
- package/{_entries → docs/_entries}/24_oncanselectnode.md +0 -0
- package/{_entries → docs/_entries}/25_oncreateli.md +2 -2
- package/{_entries → docs/_entries}/26_ondragmove.md +0 -0
- package/{_entries → docs/_entries}/27_ondragstop.md +0 -0
- package/{_entries → docs/_entries}/28_onismovehandle.md +0 -0
- package/{_entries → docs/_entries}/29_onloadfailed.md +0 -0
- package/{_entries → docs/_entries}/30_onloading.md +2 -2
- package/{_entries → docs/_entries}/31_openedicon.md +0 -0
- package/{_entries → docs/_entries}/32_openfolderdelay.md +2 -0
- package/{_entries → docs/_entries}/33_rtl.md +0 -0
- package/{_entries → docs/_entries}/34_savestate.md +0 -0
- package/{_entries → docs/_entries}/35_selectable.md +0 -0
- package/{_entries → docs/_entries}/36_showemptyfolder.md +0 -0
- package/{_entries → docs/_entries}/37_slide.md +0 -0
- package/{_entries → docs/_entries}/38_start_dnd_delay.md +0 -0
- package/{_entries → docs/_entries}/39_tabindex.md +0 -0
- package/{_entries → docs/_entries}/40_usecontextmenu.md +0 -0
- package/{_entries → docs/_entries}/41_functions.md +0 -0
- package/{_entries → docs/_entries}/42_addparentnode.md +1 -1
- package/{_entries → docs/_entries}/43_addnodeafter.md +1 -1
- package/{_entries → docs/_entries}/44_addnodebefore.md +1 -1
- package/{_entries → docs/_entries}/45_appendnode.md +5 -5
- package/{_entries → docs/_entries}/46_closenode.md +0 -0
- package/{_entries → docs/_entries}/47_destroy.md +0 -0
- package/{_entries → docs/_entries}/48_getnodebycallback.md +0 -0
- package/{_entries → docs/_entries}/49_getnodebyid.md +0 -0
- package/{_entries → docs/_entries}/50_getnodebyhtmlelement.md +2 -2
- package/{_entries → docs/_entries}/51_getselectednode.md +0 -0
- package/{_entries → docs/_entries}/52_getstate.md +0 -0
- package/{_entries → docs/_entries}/53_gettree.md +1 -1
- package/{_entries → docs/_entries}/54_isdragging.md +1 -1
- package/{_entries → docs/_entries}/55_loaddata.md +3 -3
- package/{_entries → docs/_entries}/56_loaddatafromurl.md +4 -4
- package/{_entries → docs/_entries}/57_movedown.md +0 -0
- package/{_entries → docs/_entries}/58_movenode.md +3 -3
- package/{_entries → docs/_entries}/59_moveup.md +0 -0
- package/{_entries → docs/_entries}/60_opennode.md +3 -3
- package/docs/_entries/61_prependnode.md +21 -0
- package/docs/_entries/62_refresh.md +12 -0
- package/{_entries/62_reload.md → docs/_entries/63_reload.md} +2 -2
- package/{_entries/63_removenode.md → docs/_entries/64_removenode.md} +0 -0
- package/{_entries/64_selectnode.md → docs/_entries/65_selectnode.md} +0 -0
- package/{_entries/65_scrolltonode.md → docs/_entries/66_scrolltonode.md} +0 -0
- package/{_entries/66_setoption.md → docs/_entries/67_setoption.md} +0 -0
- package/{_entries/67_setstate.md → docs/_entries/68_setstate.md} +0 -0
- package/{_entries/68_toggle.md → docs/_entries/69_toggle.md} +0 -0
- package/{_entries/69_tojson.md → docs/_entries/70_tojson.md} +0 -0
- package/{_entries/70_updatenode.md → docs/_entries/71_updatenode.md} +1 -1
- package/{_entries/71_events.md → docs/_entries/72_events.md} +0 -0
- package/{_entries/72_tree-click.md → docs/_entries/73_tree-click.md} +0 -0
- package/{_entries/73_tree-close.md → docs/_entries/74_tree-close.md} +0 -0
- package/{_entries/74_tree-contextmenu.md → docs/_entries/75_tree-contextmenu.md} +0 -0
- package/{_entries/75_tree-dblclick.md → docs/_entries/76_tree-dblclick.md} +0 -0
- package/{_entries/76_tree-init.md → docs/_entries/77_tree-init.md} +0 -0
- package/{_entries/77_tree-load-data.md → docs/_entries/78_tree-load-data.md} +0 -0
- package/{_entries/78_tree-loading-data.md → docs/_entries/79_tree-loading-data.md} +0 -0
- package/{_entries/79_tree-move.md → docs/_entries/80_tree-move.md} +0 -0
- package/{_entries/80_tree-refresh.md → docs/_entries/81_tree-refresh.md} +0 -0
- package/{_entries/81_tree-open.md → docs/_entries/82_tree-open.md} +0 -0
- package/{_entries/82_tree-select.md → docs/_entries/83_tree-select.md} +0 -0
- package/{_entries/83_multiple-selection.md → docs/_entries/84_multiple-selection.md} +0 -0
- package/{_entries/84_add-to-selection.md → docs/_entries/85_add-to-selection.md} +0 -0
- package/{_entries/85_get-selected-nodes.md → docs/_entries/86_get-selected-nodes.md} +0 -0
- package/{_entries/86_is-node-selected.md → docs/_entries/87_is-node-selected.md} +1 -1
- package/{_entries/87_remove-from-selection.md → docs/_entries/88_remove-from-selection.md} +0 -0
- package/{_entries/88_node-functions.md → docs/_entries/89_node-functions.md} +0 -0
- package/{_entries/89_children.md → docs/_entries/90_children.md} +0 -0
- package/{_entries/90_getdata.md → docs/_entries/91_getdata.md} +2 -2
- package/{_entries/91_getlevel.md → docs/_entries/92_getlevel.md} +0 -0
- package/{_entries/92_getnextnode.md → docs/_entries/93_getnextnode.md} +0 -0
- package/{_entries/93_getnextsibling.md → docs/_entries/94_getnextsibling.md} +0 -0
- package/{_entries/94_getpreviousnode.md → docs/_entries/95_getpreviousnode.md} +0 -0
- package/{_entries/95_getprevioussibling.md → docs/_entries/96_getprevioussibling.md} +0 -0
- package/{_entries/96_parent.md → docs/_entries/97_parent.md} +1 -1
- package/{_entries → docs/_entries}/insert.py +0 -0
- package/{_entries → docs/_entries}/renumber.py +0 -0
- package/{_examples → docs/_examples}/01_load_json_data.html +3 -5
- package/{_examples → docs/_examples}/02_load_json_data_from_server.html +3 -5
- package/{_examples → docs/_examples}/03_drag_and_drop.html +3 -5
- package/{_examples → docs/_examples}/04_save_state.html +3 -5
- package/{_examples → docs/_examples}/05_load_on_demand.html +3 -5
- package/{_examples → docs/_examples}/06_autoescape.html +3 -5
- package/{_examples → docs/_examples}/07_autoscroll.html +3 -5
- package/{_examples → docs/_examples}/08_multiple_select.html +3 -5
- package/{_examples → docs/_examples}/09_custom_html.html +3 -5
- package/{_examples → docs/_examples}/10_icon_buttons.html +3 -5
- package/{_examples → docs/_examples}/11_right-to-left.html +3 -5
- package/{_examples → docs/_examples}/12_button_on_right.html +3 -5
- package/docs/_examples/13_drag_outside.html +48 -0
- package/docs/_examples/14_filter.html +111 -0
- package/docs/_layouts/example.html +7 -0
- package/docs/_layouts/page.html +26 -0
- package/docs/documentation.css +3 -0
- package/docs/index.html +65 -0
- package/docs/jqtree.css +189 -0
- package/docs/package.json +22 -0
- package/docs/pnpm-lock.yaml +768 -0
- package/docs/postcss.config.js +7 -0
- package/docs/static/bower.json +8 -0
- package/docs/static/bower_components/fontawesome/css/all.min.css +5 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.eot +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.svg +774 -627
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-brands-400.woff +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.eot +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.svg +93 -95
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-regular-400.woff +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.eot +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.svg +1164 -1074
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-solid-900.woff +0 -0
- package/docs/static/bower_components/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- package/{static → docs/static}/bower_components/jquery/dist/jquery.js +118 -109
- package/docs/static/bower_components/jquery/dist/jquery.min.js +2 -0
- package/{static → docs/static}/bower_components/jquery-mockjax/dist/jquery.mockjax.js +15 -9
- package/docs/static/documentation.css +1313 -0
- package/docs/static/documentation.js +26 -0
- package/{static → docs/static}/example.css +14 -33
- package/{static → docs/static}/example.postcss +15 -32
- package/{static → docs/static}/example_data.js +33 -36
- package/{static → docs/static}/examples/autoescape.js +0 -0
- package/{static → docs/static}/examples/autoscroll.js +0 -0
- package/{static → docs/static}/examples/button-on-right.js +0 -0
- package/{static → docs/static}/examples/custom_html.js +5 -9
- package/{static → docs/static}/examples/drag-outside.js +0 -0
- package/{static → docs/static}/examples/drag_and_drop.js +0 -0
- package/docs/static/examples/filter.js +63 -0
- package/{static → docs/static}/examples/icon_buttons.js +0 -0
- package/{static → docs/static}/examples/load_json_data.js +0 -0
- package/{static → docs/static}/examples/load_json_data_from_server.js +0 -0
- package/{static → docs/static}/examples/load_on_demand.js +0 -0
- package/{static → docs/static}/examples/multiple_select.js +0 -0
- package/{static → docs/static}/examples/right-to-left.js +0 -0
- package/{static → docs/static}/examples/save_state.js +0 -0
- package/{static → docs/static}/monokai.css +0 -0
- package/{static → docs/static}/spinner.gif +0 -0
- package/docs/tailwind.config.js +16 -0
- package/docs/tree.jquery.js +21 -0
- package/jqtree.css +4 -1
- package/lib/dataLoader.js +146 -98
- package/lib/dragAndDropHandler.js +672 -470
- package/lib/elementsRenderer.js +282 -197
- package/lib/jqtreeOptions.js +1 -2
- package/lib/keyHandler.js +134 -87
- package/lib/mouse.widget.js +285 -184
- package/lib/node.js +691 -505
- package/lib/nodeElement.js +329 -205
- package/lib/playwright/coverage.js +140 -0
- package/lib/playwright/playwright.test.js +298 -179
- package/lib/playwright/testUtils.js +267 -0
- package/lib/saveStateHandler.js +311 -204
- package/lib/scrollHandler.js +293 -199
- package/lib/selectNodeHandler.js +140 -100
- package/lib/simple.widget.js +184 -109
- package/lib/test/global.d.js +3 -0
- package/lib/test/jqTree/create.test.js +44 -40
- package/lib/test/jqTree/events.test.js +186 -138
- package/lib/test/jqTree/keyboard.test.js +216 -199
- package/lib/test/jqTree/loadOnDemand.test.js +238 -157
- package/lib/test/jqTree/methods.test.js +1289 -1019
- package/lib/test/jqTree/options.test.js +491 -410
- package/lib/test/node.test.js +1036 -873
- package/lib/test/nodeUtil.test.js +21 -20
- package/lib/test/support/exampleData.js +35 -23
- package/lib/test/support/jqTreeMatchers.js +72 -54
- package/lib/test/support/matchers.d.js +1 -0
- package/lib/test/support/setupTests.js +9 -3
- package/lib/test/support/testUtil.js +35 -15
- package/lib/test/support/treeStructure.js +41 -32
- package/lib/test/util.test.js +21 -20
- package/lib/tree.jquery.d.js +1 -0
- package/lib/tree.jquery.js +1264 -886
- package/lib/types.js +1 -2
- package/lib/typings.d.js +2 -0
- package/lib/util.js +19 -8
- package/lib/version.js +8 -3
- package/package.json +54 -47
- package/src/dataLoader.ts +6 -6
- package/src/dragAndDropHandler.ts +8 -8
- package/src/elementsRenderer.ts +4 -0
- package/src/jqtreeOptions.ts +2 -2
- package/src/mouse.widget.ts +19 -15
- package/src/node.ts +27 -41
- package/src/nodeElement.ts +17 -9
- package/src/playwright/.eslintrc +5 -0
- package/src/playwright/coverage.ts +41 -0
- package/src/playwright/playwright.test.ts +75 -77
- package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-darwin.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-linux.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-darwin.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-linux.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-darwin.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-linux.png +0 -0
- package/src/playwright/testUtils.ts +122 -0
- package/src/saveStateHandler.ts +11 -6
- package/src/selectNodeHandler.ts +1 -1
- package/src/simple.widget.ts +1 -1
- package/src/test/.eslintrc +14 -0
- package/src/test/jqTree/create.test.ts +0 -1
- package/src/test/jqTree/events.test.ts +10 -10
- package/src/test/jqTree/keyboard.test.ts +0 -1
- package/src/test/jqTree/loadOnDemand.test.ts +56 -11
- package/src/test/jqTree/methods.test.ts +72 -55
- package/src/test/jqTree/options.test.ts +30 -33
- package/src/test/node.test.ts +2 -2
- package/src/test/support/jqTreeMatchers.ts +8 -9
- package/src/test/support/matchers.d.ts +2 -4
- package/src/test/support/setupTests.ts +2 -1
- package/src/tree.jquery.d.ts +19 -13
- package/src/tree.jquery.ts +35 -28
- package/src/version.ts +1 -1
- package/tree.jquery.debug.js +4810 -3325
- package/tree.jquery.debug.js.map +1 -1
- package/tree.jquery.js +3 -3
- package/tree.jquery.js.map +1 -1
- package/tsconfig.json +1 -0
- package/_entries/61_prependnode.md +0 -21
- package/_examples/13_drag_outside.html +0 -25
- package/_layouts/base.html +0 -55
- package/_layouts/frontpage.html +0 -20
- package/_layouts/page.html +0 -7
- package/index.html +0 -48
- package/jest-browser.config.js +0 -18
- package/jest-playwright.config.js +0 -21
- package/jest.config.js +0 -8
- package/lib/playwright/testUtil.js +0 -223
- package/lib/playwright/visualRegression.js +0 -128
- package/production +0 -5
- package/src/playwright/screenshots/displays_a_tree_Desktop.png +0 -0
- package/src/playwright/screenshots/displays_a_tree_iPhone 6.png +0 -0
- package/src/playwright/screenshots/moves_a_node_Desktop.png +0 -0
- package/src/playwright/screenshots/moves_a_node_iPhone 6.png +0 -0
- package/src/playwright/screenshots/opens_a_node_Desktop.png +0 -0
- package/src/playwright/screenshots/opens_a_node_iPhone 6.png +0 -0
- package/src/playwright/screenshots/selects_a_node_Desktop.png +0 -0
- package/src/playwright/screenshots/selects_a_node_iPhone 6.png +0 -0
- package/src/playwright/testUtil.ts +0 -171
- package/src/playwright/visualRegression.ts +0 -88
- package/static/bower.json +0 -9
- package/static/bower_components/bootstrap/dist/css/bootstrap-theme.min.css +0 -6
- package/static/bower_components/bootstrap/dist/css/bootstrap.min.css +0 -6
- package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
- package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +0 -288
- package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
- package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/static/bower_components/bootstrap/dist/js/bootstrap.min.js +0 -6
- package/static/bower_components/fontawesome/css/all.min.css +0 -5
- package/static/bower_components/fontawesome/webfonts/fa-brands-400.woff +0 -0
- package/static/bower_components/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- package/static/bower_components/fontawesome/webfonts/fa-regular-400.woff +0 -0
- package/static/bower_components/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- package/static/bower_components/fontawesome/webfonts/fa-solid-900.woff +0 -0
- package/static/bower_components/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- package/static/bower_components/jquery/dist/jquery.min.js +0 -2
- package/static/documentation.css +0 -171
- package/static/documentation.js +0 -48
package/lib/tree.jquery.js
CHANGED
|
@@ -1,130 +1,229 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __assign = (this && this.__assign) || function () {
|
|
16
|
-
__assign = Object.assign || function(t) {
|
|
17
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
-
s = arguments[i];
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
25
|
-
};
|
|
26
|
-
exports.__esModule = true;
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
27
6
|
exports.JqTreeWidget = void 0;
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
var
|
|
7
|
+
|
|
8
|
+
var _version = _interopRequireDefault(require("./version"));
|
|
9
|
+
|
|
10
|
+
var _dragAndDropHandler = require("./dragAndDropHandler");
|
|
11
|
+
|
|
12
|
+
var _elementsRenderer = _interopRequireDefault(require("./elementsRenderer"));
|
|
13
|
+
|
|
14
|
+
var _dataLoader = _interopRequireDefault(require("./dataLoader"));
|
|
15
|
+
|
|
16
|
+
var _keyHandler = _interopRequireDefault(require("./keyHandler"));
|
|
17
|
+
|
|
18
|
+
var _mouse = _interopRequireDefault(require("./mouse.widget"));
|
|
19
|
+
|
|
20
|
+
var _saveStateHandler = _interopRequireDefault(require("./saveStateHandler"));
|
|
21
|
+
|
|
22
|
+
var _scrollHandler = _interopRequireDefault(require("./scrollHandler"));
|
|
23
|
+
|
|
24
|
+
var _selectNodeHandler = _interopRequireDefault(require("./selectNodeHandler"));
|
|
25
|
+
|
|
26
|
+
var _simple = _interopRequireDefault(require("./simple.widget"));
|
|
27
|
+
|
|
28
|
+
var _node6 = require("./node");
|
|
29
|
+
|
|
30
|
+
var _util = require("./util");
|
|
31
|
+
|
|
32
|
+
var _nodeElement = require("./nodeElement");
|
|
33
|
+
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
|
+
|
|
36
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
37
|
+
|
|
38
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
39
|
+
|
|
40
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
41
|
+
|
|
42
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
43
|
+
|
|
44
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
45
|
+
|
|
46
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
47
|
+
|
|
48
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
49
|
+
|
|
50
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
51
|
+
|
|
52
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
53
|
+
|
|
54
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
55
|
+
|
|
56
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
57
|
+
|
|
58
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
59
|
+
|
|
60
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
61
|
+
|
|
62
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
63
|
+
|
|
64
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
65
|
+
|
|
66
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
67
|
+
|
|
68
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
69
|
+
|
|
70
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
71
|
+
|
|
72
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
73
|
+
|
|
74
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
75
|
+
|
|
76
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
77
|
+
|
|
78
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
79
|
+
|
|
80
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
81
|
+
|
|
44
82
|
var NODE_PARAM_IS_EMPTY = "Node parameter is empty";
|
|
45
83
|
var PARAM_IS_EMPTY = "Parameter is empty: ";
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var node = clickTarget.node;
|
|
60
|
-
var event_1 = _this._triggerEvent("tree.click", {
|
|
61
|
-
node: node,
|
|
62
|
-
click_event: e
|
|
63
|
-
});
|
|
64
|
-
if (!event_1.isDefaultPrevented()) {
|
|
65
|
-
_this.doSelectNode(node);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
_this.handleDblclick = function (e) {
|
|
71
|
-
var clickTarget = _this.getClickTarget(e.target);
|
|
72
|
-
if ((clickTarget === null || clickTarget === void 0 ? void 0 : clickTarget.type) === "label") {
|
|
73
|
-
_this._triggerEvent("tree.dblclick", {
|
|
74
|
-
node: clickTarget.node,
|
|
75
|
-
click_event: e
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
_this.handleContextmenu = function (e) {
|
|
80
|
-
var $div = jQuery(e.target).closest("ul.jqtree-tree .jqtree-element");
|
|
81
|
-
if ($div.length) {
|
|
82
|
-
var node = _this.getNode($div);
|
|
83
|
-
if (node) {
|
|
84
|
-
e.preventDefault();
|
|
85
|
-
e.stopPropagation();
|
|
86
|
-
_this._triggerEvent("tree.contextmenu", {
|
|
87
|
-
node: node,
|
|
88
|
-
click_event: e
|
|
89
|
-
});
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return null;
|
|
94
|
-
};
|
|
95
|
-
return _this;
|
|
84
|
+
|
|
85
|
+
var JqTreeWidget = /*#__PURE__*/function (_MouseWidget) {
|
|
86
|
+
_inherits(JqTreeWidget, _MouseWidget);
|
|
87
|
+
|
|
88
|
+
var _super = _createSuper(JqTreeWidget);
|
|
89
|
+
|
|
90
|
+
function JqTreeWidget() {
|
|
91
|
+
var _this;
|
|
92
|
+
|
|
93
|
+
_classCallCheck(this, JqTreeWidget);
|
|
94
|
+
|
|
95
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
96
|
+
args[_key] = arguments[_key];
|
|
96
97
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
|
|
99
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
100
|
+
|
|
101
|
+
_defineProperty(_assertThisInitialized(_this), "element", void 0);
|
|
102
|
+
|
|
103
|
+
_defineProperty(_assertThisInitialized(_this), "tree", void 0);
|
|
104
|
+
|
|
105
|
+
_defineProperty(_assertThisInitialized(_this), "dndHandler", void 0);
|
|
106
|
+
|
|
107
|
+
_defineProperty(_assertThisInitialized(_this), "renderer", void 0);
|
|
108
|
+
|
|
109
|
+
_defineProperty(_assertThisInitialized(_this), "dataLoader", void 0);
|
|
110
|
+
|
|
111
|
+
_defineProperty(_assertThisInitialized(_this), "scrollHandler", void 0);
|
|
112
|
+
|
|
113
|
+
_defineProperty(_assertThisInitialized(_this), "selectNodeHandler", void 0);
|
|
114
|
+
|
|
115
|
+
_defineProperty(_assertThisInitialized(_this), "isInitialized", void 0);
|
|
116
|
+
|
|
117
|
+
_defineProperty(_assertThisInitialized(_this), "saveStateHandler", void 0);
|
|
118
|
+
|
|
119
|
+
_defineProperty(_assertThisInitialized(_this), "keyHandler", void 0);
|
|
120
|
+
|
|
121
|
+
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
122
|
+
var clickTarget = _this.getClickTarget(e.target);
|
|
123
|
+
|
|
124
|
+
if (clickTarget) {
|
|
125
|
+
if (clickTarget.type === "button") {
|
|
126
|
+
_this.toggle(clickTarget.node, _this.options.slide);
|
|
127
|
+
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
e.stopPropagation();
|
|
130
|
+
} else if (clickTarget.type === "label") {
|
|
131
|
+
var _node2 = clickTarget.node;
|
|
132
|
+
|
|
133
|
+
var event = _this._triggerEvent("tree.click", {
|
|
134
|
+
node: _node2,
|
|
135
|
+
click_event: e
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
if (!event.isDefaultPrevented()) {
|
|
139
|
+
_this.doSelectNode(_node2);
|
|
140
|
+
}
|
|
105
141
|
}
|
|
106
|
-
|
|
107
|
-
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
_defineProperty(_assertThisInitialized(_this), "handleDblclick", function (e) {
|
|
146
|
+
var clickTarget = _this.getClickTarget(e.target);
|
|
147
|
+
|
|
148
|
+
if ((clickTarget === null || clickTarget === void 0 ? void 0 : clickTarget.type) === "label") {
|
|
149
|
+
_this._triggerEvent("tree.dblclick", {
|
|
150
|
+
node: clickTarget.node,
|
|
151
|
+
click_event: e
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
_defineProperty(_assertThisInitialized(_this), "handleContextmenu", function (e) {
|
|
157
|
+
var $div = jQuery(e.target).closest("ul.jqtree-tree .jqtree-element");
|
|
158
|
+
|
|
159
|
+
if ($div.length) {
|
|
160
|
+
var _node3 = _this.getNode($div);
|
|
161
|
+
|
|
162
|
+
if (_node3) {
|
|
163
|
+
e.preventDefault();
|
|
164
|
+
e.stopPropagation();
|
|
165
|
+
|
|
166
|
+
_this._triggerEvent("tree.contextmenu", {
|
|
167
|
+
node: _node3,
|
|
168
|
+
click_event: e
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
return false;
|
|
108
172
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return null;
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
return _this;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
_createClass(JqTreeWidget, [{
|
|
182
|
+
key: "toggle",
|
|
183
|
+
value: function toggle(node) {
|
|
184
|
+
var slideParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
185
|
+
|
|
186
|
+
if (!node) {
|
|
187
|
+
throw Error(NODE_PARAM_IS_EMPTY);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
var slide = slideParam !== null && slideParam !== void 0 ? slideParam : this.options.slide;
|
|
191
|
+
|
|
192
|
+
if (node.is_open) {
|
|
193
|
+
this.closeNode(node, slide);
|
|
194
|
+
} else {
|
|
195
|
+
this.openNode(node, slide);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return this.element;
|
|
199
|
+
}
|
|
200
|
+
}, {
|
|
201
|
+
key: "getTree",
|
|
202
|
+
value: function getTree() {
|
|
203
|
+
return this.tree;
|
|
204
|
+
}
|
|
205
|
+
}, {
|
|
206
|
+
key: "selectNode",
|
|
207
|
+
value: function selectNode(node, optionsParam) {
|
|
208
|
+
this.doSelectNode(node, optionsParam);
|
|
209
|
+
return this.element;
|
|
210
|
+
}
|
|
211
|
+
}, {
|
|
212
|
+
key: "getSelectedNode",
|
|
213
|
+
value: function getSelectedNode() {
|
|
214
|
+
return this.selectNodeHandler.getSelectedNode();
|
|
215
|
+
}
|
|
216
|
+
}, {
|
|
217
|
+
key: "toJson",
|
|
218
|
+
value: function toJson() {
|
|
219
|
+
return JSON.stringify(this.tree.getData());
|
|
220
|
+
}
|
|
221
|
+
}, {
|
|
222
|
+
key: "loadData",
|
|
223
|
+
value: function loadData(data, parentNode) {
|
|
224
|
+
this.doLoadData(data, parentNode);
|
|
225
|
+
return this.element;
|
|
226
|
+
}
|
|
128
227
|
/*
|
|
129
228
|
signatures:
|
|
130
229
|
- loadDataFromUrl(url, parent_node=null, on_finished=null)
|
|
@@ -132,808 +231,1087 @@ var JqTreeWidget = /** @class */ (function (_super) {
|
|
|
132
231
|
loadDataFromUrl('/my_data', node1);
|
|
133
232
|
loadDataFromUrl('/my_data', node1, function() { console.log('finished'); });
|
|
134
233
|
loadDataFromUrl('/my_data', null, function() { console.log('finished'); });
|
|
135
|
-
|
|
136
|
-
- loadDataFromUrl(parent_node=null, on_finished=null)
|
|
234
|
+
- loadDataFromUrl(parent_node=null, on_finished=null)
|
|
137
235
|
loadDataFromUrl();
|
|
138
236
|
loadDataFromUrl(node1);
|
|
139
237
|
loadDataFromUrl(null, function() { console.log('finished'); });
|
|
140
238
|
loadDataFromUrl(node1, function() { console.log('finished'); });
|
|
141
239
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
};
|
|
219
|
-
JqTreeWidget.prototype.addNodeAfter = function (newNodeInfo, existingNode) {
|
|
220
|
-
var newNode = existingNode.addAfter(newNodeInfo);
|
|
221
|
-
if (newNode) {
|
|
222
|
-
this._refreshElements(existingNode.parent);
|
|
223
|
-
}
|
|
224
|
-
return newNode;
|
|
225
|
-
};
|
|
226
|
-
JqTreeWidget.prototype.addNodeBefore = function (newNodeInfo, existingNode) {
|
|
227
|
-
if (!existingNode) {
|
|
228
|
-
throw Error(PARAM_IS_EMPTY + "existingNode");
|
|
229
|
-
}
|
|
230
|
-
var newNode = existingNode.addBefore(newNodeInfo);
|
|
231
|
-
if (newNode) {
|
|
232
|
-
this._refreshElements(existingNode.parent);
|
|
233
|
-
}
|
|
234
|
-
return newNode;
|
|
235
|
-
};
|
|
236
|
-
JqTreeWidget.prototype.addParentNode = function (newNodeInfo, existingNode) {
|
|
237
|
-
if (!existingNode) {
|
|
238
|
-
throw Error(PARAM_IS_EMPTY + "existingNode");
|
|
239
|
-
}
|
|
240
|
-
var newNode = existingNode.addParent(newNodeInfo);
|
|
241
|
-
if (newNode) {
|
|
242
|
-
this._refreshElements(newNode.parent);
|
|
243
|
-
}
|
|
244
|
-
return newNode;
|
|
245
|
-
};
|
|
246
|
-
JqTreeWidget.prototype.removeNode = function (node) {
|
|
247
|
-
if (!node) {
|
|
248
|
-
throw Error(NODE_PARAM_IS_EMPTY);
|
|
249
|
-
}
|
|
250
|
-
if (!node.parent) {
|
|
251
|
-
throw Error("Node has no parent");
|
|
252
|
-
}
|
|
253
|
-
this.selectNodeHandler.removeFromSelection(node, true); // including children
|
|
254
|
-
var parent = node.parent;
|
|
255
|
-
node.remove();
|
|
256
|
-
this._refreshElements(parent);
|
|
257
|
-
return this.element;
|
|
258
|
-
};
|
|
259
|
-
JqTreeWidget.prototype.appendNode = function (newNodeInfo, parentNodeParam) {
|
|
260
|
-
var parentNode = parentNodeParam || this.tree;
|
|
261
|
-
var node = parentNode.append(newNodeInfo);
|
|
262
|
-
this._refreshElements(parentNode);
|
|
263
|
-
return node;
|
|
264
|
-
};
|
|
265
|
-
JqTreeWidget.prototype.prependNode = function (newNodeInfo, parentNodeParam) {
|
|
266
|
-
var parentNode = parentNodeParam !== null && parentNodeParam !== void 0 ? parentNodeParam : this.tree;
|
|
267
|
-
var node = parentNode.prepend(newNodeInfo);
|
|
268
|
-
this._refreshElements(parentNode);
|
|
269
|
-
return node;
|
|
270
|
-
};
|
|
271
|
-
JqTreeWidget.prototype.updateNode = function (node, data) {
|
|
272
|
-
if (!node) {
|
|
273
|
-
throw Error(NODE_PARAM_IS_EMPTY);
|
|
274
|
-
}
|
|
275
|
-
var idIsChanged = typeof data === "object" && data.id && data.id !== node.id;
|
|
276
|
-
if (idIsChanged) {
|
|
277
|
-
this.tree.removeNodeFromIndex(node);
|
|
278
|
-
}
|
|
279
|
-
node.setData(data);
|
|
280
|
-
if (idIsChanged) {
|
|
281
|
-
this.tree.addNodeToIndex(node);
|
|
282
|
-
}
|
|
283
|
-
if (typeof data === "object" &&
|
|
284
|
-
data["children"] &&
|
|
285
|
-
data["children"] instanceof Array) {
|
|
286
|
-
node.removeChildren();
|
|
287
|
-
if (data.children.length) {
|
|
288
|
-
node.loadFromData(data.children);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
var mustSetFocus = this.selectNodeHandler.isFocusOnTree();
|
|
292
|
-
var mustSelect = this.isSelectedNodeInSubtree(node);
|
|
293
|
-
this._refreshElements(node);
|
|
294
|
-
if (mustSelect) {
|
|
295
|
-
this.selectCurrentNode(mustSetFocus);
|
|
296
|
-
}
|
|
297
|
-
return this.element;
|
|
298
|
-
};
|
|
299
|
-
JqTreeWidget.prototype.isSelectedNodeInSubtree = function (subtree) {
|
|
300
|
-
var selectedNode = this.getSelectedNode();
|
|
301
|
-
if (!selectedNode) {
|
|
302
|
-
return false;
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
return subtree === selectedNode || subtree.isParentOf(selectedNode);
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
JqTreeWidget.prototype.moveNode = function (node, targetNode, position) {
|
|
309
|
-
if (!node) {
|
|
310
|
-
throw Error(NODE_PARAM_IS_EMPTY);
|
|
311
|
-
}
|
|
312
|
-
if (!targetNode) {
|
|
313
|
-
throw Error(PARAM_IS_EMPTY + "targetNode");
|
|
314
|
-
}
|
|
315
|
-
var positionIndex = node_1.getPosition(position);
|
|
316
|
-
if (positionIndex !== undefined) {
|
|
317
|
-
this.tree.moveNode(node, targetNode, positionIndex);
|
|
318
|
-
this._refreshElements(null);
|
|
319
|
-
}
|
|
320
|
-
return this.element;
|
|
321
|
-
};
|
|
322
|
-
JqTreeWidget.prototype.getStateFromStorage = function () {
|
|
323
|
-
return this.saveStateHandler.getStateFromStorage();
|
|
324
|
-
};
|
|
325
|
-
JqTreeWidget.prototype.addToSelection = function (node, mustSetFocus) {
|
|
326
|
-
if (!node) {
|
|
327
|
-
throw Error(NODE_PARAM_IS_EMPTY);
|
|
328
|
-
}
|
|
329
|
-
this.selectNodeHandler.addToSelection(node);
|
|
330
|
-
this._getNodeElementForNode(node).select(mustSetFocus === undefined ? true : mustSetFocus);
|
|
331
|
-
this.saveState();
|
|
332
|
-
return this.element;
|
|
333
|
-
};
|
|
334
|
-
JqTreeWidget.prototype.getSelectedNodes = function () {
|
|
335
|
-
return this.selectNodeHandler.getSelectedNodes();
|
|
336
|
-
};
|
|
337
|
-
JqTreeWidget.prototype.isNodeSelected = function (node) {
|
|
338
|
-
if (!node) {
|
|
339
|
-
throw Error(NODE_PARAM_IS_EMPTY);
|
|
240
|
+
|
|
241
|
+
}, {
|
|
242
|
+
key: "loadDataFromUrl",
|
|
243
|
+
value: function loadDataFromUrl(param1, param2, param3) {
|
|
244
|
+
if (typeof param1 === "string") {
|
|
245
|
+
// first parameter is url
|
|
246
|
+
this.doLoadDataFromUrl(param1, param2, param3 !== null && param3 !== void 0 ? param3 : null);
|
|
247
|
+
} else {
|
|
248
|
+
// first parameter is not url
|
|
249
|
+
this.doLoadDataFromUrl(null, param1, param2);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return this.element;
|
|
253
|
+
}
|
|
254
|
+
}, {
|
|
255
|
+
key: "reload",
|
|
256
|
+
value: function reload(onFinished) {
|
|
257
|
+
this.doLoadDataFromUrl(null, null, onFinished);
|
|
258
|
+
return this.element;
|
|
259
|
+
}
|
|
260
|
+
}, {
|
|
261
|
+
key: "refresh",
|
|
262
|
+
value: function refresh() {
|
|
263
|
+
this._refreshElements(null);
|
|
264
|
+
|
|
265
|
+
return this.element;
|
|
266
|
+
}
|
|
267
|
+
}, {
|
|
268
|
+
key: "getNodeById",
|
|
269
|
+
value: function getNodeById(nodeId) {
|
|
270
|
+
return this.tree.getNodeById(nodeId);
|
|
271
|
+
}
|
|
272
|
+
}, {
|
|
273
|
+
key: "getNodeByName",
|
|
274
|
+
value: function getNodeByName(name) {
|
|
275
|
+
return this.tree.getNodeByName(name);
|
|
276
|
+
}
|
|
277
|
+
}, {
|
|
278
|
+
key: "getNodeByNameMustExist",
|
|
279
|
+
value: function getNodeByNameMustExist(name) {
|
|
280
|
+
return this.tree.getNodeByNameMustExist(name);
|
|
281
|
+
}
|
|
282
|
+
}, {
|
|
283
|
+
key: "getNodesByProperty",
|
|
284
|
+
value: function getNodesByProperty(key, value) {
|
|
285
|
+
return this.tree.getNodesByProperty(key, value);
|
|
286
|
+
}
|
|
287
|
+
}, {
|
|
288
|
+
key: "getNodeByHtmlElement",
|
|
289
|
+
value: function getNodeByHtmlElement(element) {
|
|
290
|
+
return this.getNode(jQuery(element));
|
|
291
|
+
}
|
|
292
|
+
}, {
|
|
293
|
+
key: "getNodeByCallback",
|
|
294
|
+
value: function getNodeByCallback(callback) {
|
|
295
|
+
return this.tree.getNodeByCallback(callback);
|
|
296
|
+
}
|
|
297
|
+
}, {
|
|
298
|
+
key: "openNode",
|
|
299
|
+
value: function openNode(node, param1, param2) {
|
|
300
|
+
var _this2 = this;
|
|
301
|
+
|
|
302
|
+
if (!node) {
|
|
303
|
+
throw Error(NODE_PARAM_IS_EMPTY);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
var parseParams = function parseParams() {
|
|
307
|
+
var onFinished;
|
|
308
|
+
var slide;
|
|
309
|
+
|
|
310
|
+
if ((0, _util.isFunction)(param1)) {
|
|
311
|
+
onFinished = param1;
|
|
312
|
+
slide = null;
|
|
313
|
+
} else {
|
|
314
|
+
slide = param1;
|
|
315
|
+
onFinished = param2;
|
|
340
316
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
317
|
+
|
|
318
|
+
if (slide == null) {
|
|
319
|
+
var _this2$options$slide;
|
|
320
|
+
|
|
321
|
+
slide = (_this2$options$slide = _this2.options.slide) !== null && _this2$options$slide !== void 0 ? _this2$options$slide : false;
|
|
346
322
|
}
|
|
347
|
-
|
|
348
|
-
|
|
323
|
+
|
|
324
|
+
return [slide, onFinished];
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
var _parseParams = parseParams(),
|
|
328
|
+
_parseParams2 = _slicedToArray(_parseParams, 2),
|
|
329
|
+
slide = _parseParams2[0],
|
|
330
|
+
onFinished = _parseParams2[1];
|
|
331
|
+
|
|
332
|
+
this._openNode(node, slide, onFinished);
|
|
333
|
+
|
|
334
|
+
return this.element;
|
|
335
|
+
}
|
|
336
|
+
}, {
|
|
337
|
+
key: "closeNode",
|
|
338
|
+
value: function closeNode(node, slideParam) {
|
|
339
|
+
if (!node) {
|
|
340
|
+
throw Error(NODE_PARAM_IS_EMPTY);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
var slide = slideParam !== null && slideParam !== void 0 ? slideParam : this.options.slide;
|
|
344
|
+
|
|
345
|
+
if (node.isFolder() || node.isEmptyFolder) {
|
|
346
|
+
new _nodeElement.FolderElement(node, this).close(slide, this.options.animationSpeed);
|
|
349
347
|
this.saveState();
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
return this.element;
|
|
351
|
+
}
|
|
352
|
+
}, {
|
|
353
|
+
key: "isDragging",
|
|
354
|
+
value: function isDragging() {
|
|
355
|
+
return this.dndHandler.isDragging;
|
|
356
|
+
}
|
|
357
|
+
}, {
|
|
358
|
+
key: "refreshHitAreas",
|
|
359
|
+
value: function refreshHitAreas() {
|
|
360
|
+
this.dndHandler.refresh();
|
|
361
|
+
return this.element;
|
|
362
|
+
}
|
|
363
|
+
}, {
|
|
364
|
+
key: "addNodeAfter",
|
|
365
|
+
value: function addNodeAfter(newNodeInfo, existingNode) {
|
|
366
|
+
var newNode = existingNode.addAfter(newNodeInfo);
|
|
367
|
+
|
|
368
|
+
if (newNode) {
|
|
369
|
+
this._refreshElements(existingNode.parent);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
return newNode;
|
|
373
|
+
}
|
|
374
|
+
}, {
|
|
375
|
+
key: "addNodeBefore",
|
|
376
|
+
value: function addNodeBefore(newNodeInfo, existingNode) {
|
|
377
|
+
if (!existingNode) {
|
|
378
|
+
throw Error(PARAM_IS_EMPTY + "existingNode");
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
var newNode = existingNode.addBefore(newNodeInfo);
|
|
382
|
+
|
|
383
|
+
if (newNode) {
|
|
384
|
+
this._refreshElements(existingNode.parent);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
return newNode;
|
|
388
|
+
}
|
|
389
|
+
}, {
|
|
390
|
+
key: "addParentNode",
|
|
391
|
+
value: function addParentNode(newNodeInfo, existingNode) {
|
|
392
|
+
if (!existingNode) {
|
|
393
|
+
throw Error(PARAM_IS_EMPTY + "existingNode");
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
var newNode = existingNode.addParent(newNodeInfo);
|
|
397
|
+
|
|
398
|
+
if (newNode) {
|
|
399
|
+
this._refreshElements(newNode.parent);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
return newNode;
|
|
403
|
+
}
|
|
404
|
+
}, {
|
|
405
|
+
key: "removeNode",
|
|
406
|
+
value: function removeNode(node) {
|
|
407
|
+
if (!node) {
|
|
408
|
+
throw Error(NODE_PARAM_IS_EMPTY);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
if (!node.parent) {
|
|
412
|
+
throw Error("Node has no parent");
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
this.selectNodeHandler.removeFromSelection(node, true); // including children
|
|
416
|
+
|
|
417
|
+
var parent = node.parent;
|
|
418
|
+
node.remove();
|
|
419
|
+
|
|
420
|
+
this._refreshElements(parent);
|
|
421
|
+
|
|
422
|
+
return this.element;
|
|
423
|
+
}
|
|
424
|
+
}, {
|
|
425
|
+
key: "appendNode",
|
|
426
|
+
value: function appendNode(newNodeInfo, parentNodeParam) {
|
|
427
|
+
var parentNode = parentNodeParam || this.tree;
|
|
428
|
+
var node = parentNode.append(newNodeInfo);
|
|
429
|
+
|
|
430
|
+
this._refreshElements(parentNode);
|
|
431
|
+
|
|
432
|
+
return node;
|
|
433
|
+
}
|
|
434
|
+
}, {
|
|
435
|
+
key: "prependNode",
|
|
436
|
+
value: function prependNode(newNodeInfo, parentNodeParam) {
|
|
437
|
+
var parentNode = parentNodeParam !== null && parentNodeParam !== void 0 ? parentNodeParam : this.tree;
|
|
438
|
+
var node = parentNode.prepend(newNodeInfo);
|
|
439
|
+
|
|
440
|
+
this._refreshElements(parentNode);
|
|
441
|
+
|
|
442
|
+
return node;
|
|
443
|
+
}
|
|
444
|
+
}, {
|
|
445
|
+
key: "updateNode",
|
|
446
|
+
value: function updateNode(node, data) {
|
|
447
|
+
if (!node) {
|
|
448
|
+
throw Error(NODE_PARAM_IS_EMPTY);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
var idIsChanged = _typeof(data) === "object" && data.id && data.id !== node.id;
|
|
452
|
+
|
|
453
|
+
if (idIsChanged) {
|
|
454
|
+
this.tree.removeNodeFromIndex(node);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
node.setData(data);
|
|
458
|
+
|
|
459
|
+
if (idIsChanged) {
|
|
460
|
+
this.tree.addNodeToIndex(node);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
if (_typeof(data) === "object" && data["children"] && data["children"] instanceof Array) {
|
|
464
|
+
node.removeChildren();
|
|
465
|
+
|
|
466
|
+
if (data.children.length) {
|
|
467
|
+
node.loadFromData(data.children);
|
|
355
468
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
this._refreshElements(node);
|
|
472
|
+
|
|
473
|
+
return this.element;
|
|
474
|
+
}
|
|
475
|
+
}, {
|
|
476
|
+
key: "isSelectedNodeInSubtree",
|
|
477
|
+
value: function isSelectedNodeInSubtree(subtree) {
|
|
478
|
+
var selectedNode = this.getSelectedNode();
|
|
479
|
+
|
|
480
|
+
if (!selectedNode) {
|
|
481
|
+
return false;
|
|
482
|
+
} else {
|
|
483
|
+
return subtree === selectedNode || subtree.isParentOf(selectedNode);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}, {
|
|
487
|
+
key: "moveNode",
|
|
488
|
+
value: function moveNode(node, targetNode, position) {
|
|
489
|
+
if (!node) {
|
|
490
|
+
throw Error(NODE_PARAM_IS_EMPTY);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
if (!targetNode) {
|
|
494
|
+
throw Error(PARAM_IS_EMPTY + "targetNode");
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
var positionIndex = (0, _node6.getPosition)(position);
|
|
498
|
+
|
|
499
|
+
if (positionIndex !== undefined) {
|
|
500
|
+
this.tree.moveNode(node, targetNode, positionIndex);
|
|
501
|
+
|
|
369
502
|
this._refreshElements(null);
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
return this.element;
|
|
506
|
+
}
|
|
507
|
+
}, {
|
|
508
|
+
key: "getStateFromStorage",
|
|
509
|
+
value: function getStateFromStorage() {
|
|
510
|
+
return this.saveStateHandler.getStateFromStorage();
|
|
511
|
+
}
|
|
512
|
+
}, {
|
|
513
|
+
key: "addToSelection",
|
|
514
|
+
value: function addToSelection(node, mustSetFocus) {
|
|
515
|
+
if (!node) {
|
|
516
|
+
throw Error(NODE_PARAM_IS_EMPTY);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
this.selectNodeHandler.addToSelection(node);
|
|
520
|
+
|
|
521
|
+
this._getNodeElementForNode(node).select(mustSetFocus === undefined ? true : mustSetFocus);
|
|
522
|
+
|
|
523
|
+
this.saveState();
|
|
524
|
+
return this.element;
|
|
525
|
+
}
|
|
526
|
+
}, {
|
|
527
|
+
key: "getSelectedNodes",
|
|
528
|
+
value: function getSelectedNodes() {
|
|
529
|
+
return this.selectNodeHandler.getSelectedNodes();
|
|
530
|
+
}
|
|
531
|
+
}, {
|
|
532
|
+
key: "isNodeSelected",
|
|
533
|
+
value: function isNodeSelected(node) {
|
|
534
|
+
if (!node) {
|
|
535
|
+
throw Error(NODE_PARAM_IS_EMPTY);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
return this.selectNodeHandler.isNodeSelected(node);
|
|
539
|
+
}
|
|
540
|
+
}, {
|
|
541
|
+
key: "removeFromSelection",
|
|
542
|
+
value: function removeFromSelection(node) {
|
|
543
|
+
if (!node) {
|
|
544
|
+
throw Error(NODE_PARAM_IS_EMPTY);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
this.selectNodeHandler.removeFromSelection(node);
|
|
548
|
+
|
|
549
|
+
this._getNodeElementForNode(node).deselect();
|
|
550
|
+
|
|
551
|
+
this.saveState();
|
|
552
|
+
return this.element;
|
|
553
|
+
}
|
|
554
|
+
}, {
|
|
555
|
+
key: "scrollToNode",
|
|
556
|
+
value: function scrollToNode(node) {
|
|
557
|
+
if (!node) {
|
|
558
|
+
throw Error(NODE_PARAM_IS_EMPTY);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
var nodeOffset = jQuery(node.element).offset();
|
|
562
|
+
var nodeTop = nodeOffset ? nodeOffset.top : 0;
|
|
563
|
+
var treeOffset = this.$el.offset();
|
|
564
|
+
var treeTop = treeOffset ? treeOffset.top : 0;
|
|
565
|
+
var top = nodeTop - treeTop;
|
|
566
|
+
this.scrollHandler.scrollToY(top);
|
|
567
|
+
return this.element;
|
|
568
|
+
}
|
|
569
|
+
}, {
|
|
570
|
+
key: "getState",
|
|
571
|
+
value: function getState() {
|
|
572
|
+
return this.saveStateHandler.getState();
|
|
573
|
+
}
|
|
574
|
+
}, {
|
|
575
|
+
key: "setState",
|
|
576
|
+
value: function setState(state) {
|
|
577
|
+
this.saveStateHandler.setInitialState(state);
|
|
578
|
+
|
|
579
|
+
this._refreshElements(null);
|
|
580
|
+
|
|
581
|
+
return this.element;
|
|
582
|
+
}
|
|
583
|
+
}, {
|
|
584
|
+
key: "setOption",
|
|
585
|
+
value: function setOption(option, value) {
|
|
586
|
+
this.options[option] = value;
|
|
587
|
+
return this.element;
|
|
588
|
+
}
|
|
589
|
+
}, {
|
|
590
|
+
key: "moveDown",
|
|
591
|
+
value: function moveDown() {
|
|
592
|
+
var selectedNode = this.getSelectedNode();
|
|
593
|
+
|
|
594
|
+
if (selectedNode) {
|
|
595
|
+
this.keyHandler.moveDown(selectedNode);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
return this.element;
|
|
599
|
+
}
|
|
600
|
+
}, {
|
|
601
|
+
key: "moveUp",
|
|
602
|
+
value: function moveUp() {
|
|
603
|
+
var selectedNode = this.getSelectedNode();
|
|
604
|
+
|
|
605
|
+
if (selectedNode) {
|
|
606
|
+
this.keyHandler.moveUp(selectedNode);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return this.element;
|
|
610
|
+
}
|
|
611
|
+
}, {
|
|
612
|
+
key: "getVersion",
|
|
613
|
+
value: function getVersion() {
|
|
614
|
+
return _version["default"];
|
|
615
|
+
}
|
|
616
|
+
}, {
|
|
617
|
+
key: "_triggerEvent",
|
|
618
|
+
value: function _triggerEvent(eventName, values) {
|
|
619
|
+
var event = jQuery.Event(eventName, values);
|
|
620
|
+
this.element.trigger(event);
|
|
621
|
+
return event;
|
|
622
|
+
}
|
|
623
|
+
}, {
|
|
624
|
+
key: "_openNode",
|
|
625
|
+
value: function _openNode(node) {
|
|
626
|
+
var _this3 = this;
|
|
627
|
+
|
|
628
|
+
var slide = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
629
|
+
var onFinished = arguments.length > 2 ? arguments[2] : undefined;
|
|
630
|
+
|
|
631
|
+
var doOpenNode = function doOpenNode(_node, _slide, _onFinished) {
|
|
632
|
+
var folderElement = new _nodeElement.FolderElement(_node, _this3);
|
|
633
|
+
folderElement.open(_onFinished, _slide, _this3.options.animationSpeed);
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
if (node.isFolder() || node.isEmptyFolder) {
|
|
637
|
+
if (node.load_on_demand) {
|
|
638
|
+
this.loadFolderOnDemand(node, slide, onFinished);
|
|
639
|
+
} else {
|
|
640
|
+
var parent = node.parent;
|
|
641
|
+
|
|
642
|
+
while (parent) {
|
|
643
|
+
// nb: do not open root element
|
|
644
|
+
if (parent.parent) {
|
|
645
|
+
doOpenNode(parent, false, null);
|
|
420
646
|
}
|
|
647
|
+
|
|
648
|
+
parent = parent.parent;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
doOpenNode(node, slide, onFinished);
|
|
652
|
+
this.saveState();
|
|
421
653
|
}
|
|
422
|
-
|
|
654
|
+
}
|
|
655
|
+
}
|
|
423
656
|
/*
|
|
424
657
|
Redraw the tree or part of the tree.
|
|
425
658
|
from_node: redraw this subtree
|
|
426
659
|
*/
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
660
|
+
|
|
661
|
+
}, {
|
|
662
|
+
key: "_refreshElements",
|
|
663
|
+
value: function _refreshElements(fromNode) {
|
|
664
|
+
var mustSetFocus = this.selectNodeHandler.isFocusOnTree();
|
|
665
|
+
var mustSelect = fromNode ? this.isSelectedNodeInSubtree(fromNode) : false;
|
|
666
|
+
this.renderer.render(fromNode);
|
|
667
|
+
|
|
668
|
+
if (mustSelect) {
|
|
669
|
+
this.selectCurrentNode(mustSetFocus);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
this._triggerEvent("tree.refresh");
|
|
673
|
+
}
|
|
674
|
+
}, {
|
|
675
|
+
key: "_getNodeElementForNode",
|
|
676
|
+
value: function _getNodeElementForNode(node) {
|
|
677
|
+
if (node.isFolder()) {
|
|
678
|
+
return new _nodeElement.FolderElement(node, this);
|
|
679
|
+
} else {
|
|
680
|
+
return new _nodeElement.NodeElement(node, this);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}, {
|
|
684
|
+
key: "_getNodeElement",
|
|
685
|
+
value: function _getNodeElement($element) {
|
|
686
|
+
var node = this.getNode($element);
|
|
687
|
+
|
|
688
|
+
if (node) {
|
|
689
|
+
return this._getNodeElementForNode(node);
|
|
690
|
+
} else {
|
|
691
|
+
return null;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}, {
|
|
695
|
+
key: "_containsElement",
|
|
696
|
+
value: function _containsElement(element) {
|
|
697
|
+
var node = this.getNode(jQuery(element));
|
|
698
|
+
return node != null && node.tree === this.tree;
|
|
699
|
+
}
|
|
700
|
+
}, {
|
|
701
|
+
key: "_getScrollLeft",
|
|
702
|
+
value: function _getScrollLeft() {
|
|
703
|
+
return this.scrollHandler.getScrollLeft();
|
|
704
|
+
}
|
|
705
|
+
}, {
|
|
706
|
+
key: "init",
|
|
707
|
+
value: function init() {
|
|
708
|
+
_get(_getPrototypeOf(JqTreeWidget.prototype), "init", this).call(this);
|
|
709
|
+
|
|
710
|
+
this.element = this.$el;
|
|
711
|
+
this.isInitialized = false;
|
|
712
|
+
this.options.rtl = this.getRtlOption();
|
|
713
|
+
|
|
714
|
+
if (this.options.closedIcon == null) {
|
|
715
|
+
this.options.closedIcon = this.getDefaultClosedIcon();
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
this.renderer = new _elementsRenderer["default"](this);
|
|
719
|
+
this.dataLoader = new _dataLoader["default"](this);
|
|
720
|
+
this.saveStateHandler = new _saveStateHandler["default"](this);
|
|
721
|
+
this.selectNodeHandler = new _selectNodeHandler["default"](this);
|
|
722
|
+
this.dndHandler = new _dragAndDropHandler.DragAndDropHandler(this);
|
|
723
|
+
this.scrollHandler = new _scrollHandler["default"](this);
|
|
724
|
+
this.keyHandler = new _keyHandler["default"](this);
|
|
725
|
+
this.initData();
|
|
726
|
+
this.element.on("click", this.handleClick);
|
|
727
|
+
this.element.on("dblclick", this.handleDblclick);
|
|
728
|
+
|
|
729
|
+
if (this.options.useContextMenu) {
|
|
730
|
+
this.element.on("contextmenu", this.handleContextmenu);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}, {
|
|
734
|
+
key: "deinit",
|
|
735
|
+
value: function deinit() {
|
|
736
|
+
this.element.empty();
|
|
737
|
+
this.element.off();
|
|
738
|
+
this.keyHandler.deinit();
|
|
739
|
+
this.tree = new _node6.Node({}, true);
|
|
740
|
+
|
|
741
|
+
_get(_getPrototypeOf(JqTreeWidget.prototype), "deinit", this).call(this);
|
|
742
|
+
}
|
|
743
|
+
}, {
|
|
744
|
+
key: "mouseCapture",
|
|
745
|
+
value: function mouseCapture(positionInfo) {
|
|
746
|
+
if (this.options.dragAndDrop) {
|
|
747
|
+
return this.dndHandler.mouseCapture(positionInfo);
|
|
748
|
+
} else {
|
|
749
|
+
return false;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}, {
|
|
753
|
+
key: "mouseStart",
|
|
754
|
+
value: function mouseStart(positionInfo) {
|
|
755
|
+
if (this.options.dragAndDrop) {
|
|
756
|
+
return this.dndHandler.mouseStart(positionInfo);
|
|
757
|
+
} else {
|
|
758
|
+
return false;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}, {
|
|
762
|
+
key: "mouseDrag",
|
|
763
|
+
value: function mouseDrag(positionInfo) {
|
|
764
|
+
if (this.options.dragAndDrop) {
|
|
765
|
+
var result = this.dndHandler.mouseDrag(positionInfo);
|
|
766
|
+
this.scrollHandler.checkScrolling();
|
|
767
|
+
return result;
|
|
768
|
+
} else {
|
|
769
|
+
return false;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}, {
|
|
773
|
+
key: "mouseStop",
|
|
774
|
+
value: function mouseStop(positionInfo) {
|
|
775
|
+
if (this.options.dragAndDrop) {
|
|
776
|
+
return this.dndHandler.mouseStop(positionInfo);
|
|
777
|
+
} else {
|
|
778
|
+
return false;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}, {
|
|
782
|
+
key: "getMouseDelay",
|
|
783
|
+
value: function getMouseDelay() {
|
|
784
|
+
var _this$options$startDn;
|
|
785
|
+
|
|
786
|
+
return (_this$options$startDn = this.options.startDndDelay) !== null && _this$options$startDn !== void 0 ? _this$options$startDn : 0;
|
|
787
|
+
}
|
|
788
|
+
}, {
|
|
789
|
+
key: "initData",
|
|
790
|
+
value: function initData() {
|
|
791
|
+
if (this.options.data) {
|
|
792
|
+
this.doLoadData(this.options.data, null);
|
|
793
|
+
} else {
|
|
794
|
+
var dataUrl = this.getDataUrlInfo(null);
|
|
795
|
+
|
|
796
|
+
if (dataUrl) {
|
|
797
|
+
this.doLoadDataFromUrl(null, null, null);
|
|
798
|
+
} else {
|
|
799
|
+
this.doLoadData([], null);
|
|
462
800
|
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}, {
|
|
804
|
+
key: "getDataUrlInfo",
|
|
805
|
+
value: function getDataUrlInfo(node) {
|
|
806
|
+
var _this4 = this;
|
|
807
|
+
|
|
808
|
+
var dataUrl = this.options.dataUrl || this.element.data("url");
|
|
809
|
+
|
|
810
|
+
var getUrlFromString = function getUrlFromString(url) {
|
|
811
|
+
var urlInfo = {
|
|
812
|
+
url: url
|
|
813
|
+
};
|
|
814
|
+
setUrlInfoData(urlInfo);
|
|
815
|
+
return urlInfo;
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
var setUrlInfoData = function setUrlInfoData(urlInfo) {
|
|
819
|
+
if (node !== null && node !== void 0 && node.id) {
|
|
820
|
+
// Load on demand of a subtree; add node parameter
|
|
821
|
+
var data = {
|
|
822
|
+
node: node.id
|
|
823
|
+
};
|
|
824
|
+
urlInfo["data"] = data;
|
|
825
|
+
} else {
|
|
826
|
+
// Add selected_node parameter
|
|
827
|
+
var selectedNodeId = _this4.getNodeIdToBeSelected();
|
|
828
|
+
|
|
829
|
+
if (selectedNodeId) {
|
|
830
|
+
var _data = {
|
|
831
|
+
selected_node: selectedNodeId
|
|
832
|
+
};
|
|
833
|
+
urlInfo["data"] = _data;
|
|
834
|
+
}
|
|
475
835
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
if (typeof dataUrl === "function") {
|
|
839
|
+
return dataUrl(node);
|
|
840
|
+
} else if (typeof dataUrl === "string") {
|
|
841
|
+
return getUrlFromString(dataUrl);
|
|
842
|
+
} else if (dataUrl && _typeof(dataUrl) === "object") {
|
|
843
|
+
setUrlInfoData(dataUrl);
|
|
844
|
+
return dataUrl;
|
|
845
|
+
} else {
|
|
846
|
+
return null;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
}, {
|
|
850
|
+
key: "getNodeIdToBeSelected",
|
|
851
|
+
value: function getNodeIdToBeSelected() {
|
|
852
|
+
if (this.options.saveState) {
|
|
853
|
+
return this.saveStateHandler.getNodeIdToBeSelected();
|
|
854
|
+
} else {
|
|
855
|
+
return null;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}, {
|
|
859
|
+
key: "initTree",
|
|
860
|
+
value: function initTree(data) {
|
|
861
|
+
var _this5 = this;
|
|
862
|
+
|
|
863
|
+
var doInit = function doInit() {
|
|
864
|
+
if (!_this5.isInitialized) {
|
|
865
|
+
_this5.isInitialized = true;
|
|
866
|
+
|
|
867
|
+
_this5._triggerEvent("tree.init");
|
|
487
868
|
}
|
|
488
|
-
|
|
489
|
-
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
if (!this.options.nodeClass) {
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
this.tree = new this.options.nodeClass(null, true, this.options.nodeClass);
|
|
876
|
+
this.selectNodeHandler.clear();
|
|
877
|
+
this.tree.loadFromData(data);
|
|
878
|
+
var mustLoadOnDemand = this.setInitialState();
|
|
879
|
+
|
|
880
|
+
this._refreshElements(null);
|
|
881
|
+
|
|
882
|
+
if (!mustLoadOnDemand) {
|
|
883
|
+
doInit();
|
|
884
|
+
} else {
|
|
885
|
+
// Load data on demand and then init the tree
|
|
886
|
+
this.setInitialStateOnDemand(doInit);
|
|
887
|
+
}
|
|
888
|
+
} // Set initial state, either by restoring the state or auto-opening nodes
|
|
889
|
+
// result: must load nodes on demand?
|
|
890
|
+
|
|
891
|
+
}, {
|
|
892
|
+
key: "setInitialState",
|
|
893
|
+
value: function setInitialState() {
|
|
894
|
+
var _this6 = this;
|
|
895
|
+
|
|
896
|
+
var restoreState = function restoreState() {
|
|
897
|
+
// result: is state restored, must load on demand?
|
|
898
|
+
if (!_this6.options.saveState) {
|
|
899
|
+
return [false, false];
|
|
900
|
+
} else {
|
|
901
|
+
var state = _this6.saveStateHandler.getStateFromStorage();
|
|
902
|
+
|
|
903
|
+
if (!state) {
|
|
904
|
+
return [false, false];
|
|
905
|
+
} else {
|
|
906
|
+
var _mustLoadOnDemand = _this6.saveStateHandler.setInitialState(state); // return true: the state is restored
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
return [true, _mustLoadOnDemand];
|
|
910
|
+
}
|
|
490
911
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
var autoOpenNodes = function autoOpenNodes() {
|
|
915
|
+
// result: must load on demand?
|
|
916
|
+
if (_this6.options.autoOpen === false) {
|
|
917
|
+
return false;
|
|
495
918
|
}
|
|
496
|
-
|
|
919
|
+
|
|
920
|
+
var maxLevel = _this6.getAutoOpenMaxLevel();
|
|
921
|
+
|
|
922
|
+
var mustLoadOnDemand = false;
|
|
923
|
+
|
|
924
|
+
_this6.tree.iterate(function (node, level) {
|
|
925
|
+
if (node.load_on_demand) {
|
|
926
|
+
mustLoadOnDemand = true;
|
|
497
927
|
return false;
|
|
498
|
-
|
|
499
|
-
};
|
|
500
|
-
JqTreeWidget.prototype.mouseDrag = function (positionInfo) {
|
|
501
|
-
if (this.options.dragAndDrop) {
|
|
502
|
-
var result = this.dndHandler.mouseDrag(positionInfo);
|
|
503
|
-
this.scrollHandler.checkScrolling();
|
|
504
|
-
return result;
|
|
505
|
-
}
|
|
506
|
-
else {
|
|
928
|
+
} else if (!node.hasChildren()) {
|
|
507
929
|
return false;
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
930
|
+
} else {
|
|
931
|
+
node.is_open = true;
|
|
932
|
+
return level !== maxLevel;
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
|
|
936
|
+
return mustLoadOnDemand;
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
var _restoreState = restoreState(),
|
|
940
|
+
_restoreState2 = _slicedToArray(_restoreState, 2),
|
|
941
|
+
isRestored = _restoreState2[0],
|
|
942
|
+
mustLoadOnDemand = _restoreState2[1]; // eslint-disable-line prefer-const
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
if (!isRestored) {
|
|
946
|
+
mustLoadOnDemand = autoOpenNodes();
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
return mustLoadOnDemand;
|
|
950
|
+
} // Set the initial state for nodes that are loaded on demand
|
|
951
|
+
// Call cb_finished when done
|
|
952
|
+
|
|
953
|
+
}, {
|
|
954
|
+
key: "setInitialStateOnDemand",
|
|
955
|
+
value: function setInitialStateOnDemand(cbFinished) {
|
|
956
|
+
var _this7 = this;
|
|
957
|
+
|
|
958
|
+
var restoreState = function restoreState() {
|
|
959
|
+
if (!_this7.options.saveState) {
|
|
960
|
+
return false;
|
|
961
|
+
} else {
|
|
962
|
+
var state = _this7.saveStateHandler.getStateFromStorage();
|
|
963
|
+
|
|
964
|
+
if (!state) {
|
|
515
965
|
return false;
|
|
966
|
+
} else {
|
|
967
|
+
_this7.saveStateHandler.setInitialStateOnDemand(state, cbFinished);
|
|
968
|
+
|
|
969
|
+
return true;
|
|
970
|
+
}
|
|
516
971
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
else {
|
|
532
|
-
this.doLoadData([], null);
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
};
|
|
536
|
-
JqTreeWidget.prototype.getDataUrlInfo = function (node) {
|
|
537
|
-
var _this = this;
|
|
538
|
-
var dataUrl = this.options.dataUrl || this.element.data("url");
|
|
539
|
-
var getUrlFromString = function (url) {
|
|
540
|
-
var urlInfo = { url: url };
|
|
541
|
-
setUrlInfoData(urlInfo);
|
|
542
|
-
return urlInfo;
|
|
543
|
-
};
|
|
544
|
-
var setUrlInfoData = function (urlInfo) {
|
|
545
|
-
if (node === null || node === void 0 ? void 0 : node.id) {
|
|
546
|
-
// Load on demand of a subtree; add node parameter
|
|
547
|
-
var data = { node: node.id };
|
|
548
|
-
urlInfo["data"] = data;
|
|
549
|
-
}
|
|
550
|
-
else {
|
|
551
|
-
// Add selected_node parameter
|
|
552
|
-
var selectedNodeId = _this.getNodeIdToBeSelected();
|
|
553
|
-
if (selectedNodeId) {
|
|
554
|
-
var data = { selected_node: selectedNodeId };
|
|
555
|
-
urlInfo["data"] = data;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
};
|
|
559
|
-
if (typeof dataUrl === "function") {
|
|
560
|
-
return dataUrl(node);
|
|
561
|
-
}
|
|
562
|
-
else if (typeof dataUrl === "string") {
|
|
563
|
-
return getUrlFromString(dataUrl);
|
|
564
|
-
}
|
|
565
|
-
else if (dataUrl && typeof dataUrl === "object") {
|
|
566
|
-
setUrlInfoData(dataUrl);
|
|
567
|
-
return dataUrl;
|
|
568
|
-
}
|
|
569
|
-
else {
|
|
570
|
-
return null;
|
|
571
|
-
}
|
|
572
|
-
};
|
|
573
|
-
JqTreeWidget.prototype.getNodeIdToBeSelected = function () {
|
|
574
|
-
if (this.options.saveState) {
|
|
575
|
-
return this.saveStateHandler.getNodeIdToBeSelected();
|
|
576
|
-
}
|
|
577
|
-
else {
|
|
578
|
-
return null;
|
|
579
|
-
}
|
|
580
|
-
};
|
|
581
|
-
JqTreeWidget.prototype.initTree = function (data) {
|
|
582
|
-
var _this = this;
|
|
583
|
-
var doInit = function () {
|
|
584
|
-
if (!_this.isInitialized) {
|
|
585
|
-
_this.isInitialized = true;
|
|
586
|
-
_this._triggerEvent("tree.init");
|
|
587
|
-
}
|
|
588
|
-
};
|
|
589
|
-
if (!this.options.nodeClass) {
|
|
590
|
-
return;
|
|
591
|
-
}
|
|
592
|
-
this.tree = new this.options.nodeClass(null, true, this.options.nodeClass);
|
|
593
|
-
this.selectNodeHandler.clear();
|
|
594
|
-
this.tree.loadFromData(data);
|
|
595
|
-
var mustLoadOnDemand = this.setInitialState();
|
|
596
|
-
this._refreshElements(null);
|
|
597
|
-
if (!mustLoadOnDemand) {
|
|
598
|
-
doInit();
|
|
599
|
-
}
|
|
600
|
-
else {
|
|
601
|
-
// Load data on demand and then init the tree
|
|
602
|
-
this.setInitialStateOnDemand(doInit);
|
|
603
|
-
}
|
|
604
|
-
};
|
|
605
|
-
// Set initial state, either by restoring the state or auto-opening nodes
|
|
606
|
-
// result: must load nodes on demand?
|
|
607
|
-
JqTreeWidget.prototype.setInitialState = function () {
|
|
608
|
-
var _this = this;
|
|
609
|
-
var restoreState = function () {
|
|
610
|
-
// result: is state restored, must load on demand?
|
|
611
|
-
if (!_this.options.saveState) {
|
|
612
|
-
return [false, false];
|
|
613
|
-
}
|
|
614
|
-
else {
|
|
615
|
-
var state = _this.saveStateHandler.getStateFromStorage();
|
|
616
|
-
if (!state) {
|
|
617
|
-
return [false, false];
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
var mustLoadOnDemand_1 = _this.saveStateHandler.setInitialState(state);
|
|
621
|
-
// return true: the state is restored
|
|
622
|
-
return [true, mustLoadOnDemand_1];
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
};
|
|
626
|
-
var autoOpenNodes = function () {
|
|
627
|
-
// result: must load on demand?
|
|
628
|
-
if (_this.options.autoOpen === false) {
|
|
629
|
-
return false;
|
|
630
|
-
}
|
|
631
|
-
var maxLevel = _this.getAutoOpenMaxLevel();
|
|
632
|
-
var mustLoadOnDemand = false;
|
|
633
|
-
_this.tree.iterate(function (node, level) {
|
|
634
|
-
if (node.load_on_demand) {
|
|
635
|
-
mustLoadOnDemand = true;
|
|
636
|
-
return false;
|
|
637
|
-
}
|
|
638
|
-
else if (!node.hasChildren()) {
|
|
639
|
-
return false;
|
|
640
|
-
}
|
|
641
|
-
else {
|
|
642
|
-
node.is_open = true;
|
|
643
|
-
return level !== maxLevel;
|
|
644
|
-
}
|
|
645
|
-
});
|
|
646
|
-
return mustLoadOnDemand;
|
|
972
|
+
};
|
|
973
|
+
|
|
974
|
+
var autoOpenNodes = function autoOpenNodes() {
|
|
975
|
+
var maxLevel = _this7.getAutoOpenMaxLevel();
|
|
976
|
+
|
|
977
|
+
var loadingCount = 0;
|
|
978
|
+
|
|
979
|
+
var loadAndOpenNode = function loadAndOpenNode(node) {
|
|
980
|
+
loadingCount += 1;
|
|
981
|
+
|
|
982
|
+
_this7._openNode(node, false, function () {
|
|
983
|
+
loadingCount -= 1;
|
|
984
|
+
openNodes();
|
|
985
|
+
});
|
|
647
986
|
};
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
}
|
|
662
|
-
else {
|
|
663
|
-
var state = _this.saveStateHandler.getStateFromStorage();
|
|
664
|
-
if (!state) {
|
|
665
|
-
return false;
|
|
666
|
-
}
|
|
667
|
-
else {
|
|
668
|
-
_this.saveStateHandler.setInitialStateOnDemand(state, cbFinished);
|
|
669
|
-
return true;
|
|
670
|
-
}
|
|
987
|
+
|
|
988
|
+
var openNodes = function openNodes() {
|
|
989
|
+
_this7.tree.iterate(function (node, level) {
|
|
990
|
+
if (node.load_on_demand) {
|
|
991
|
+
if (!node.is_loading) {
|
|
992
|
+
loadAndOpenNode(node);
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
return false;
|
|
996
|
+
} else {
|
|
997
|
+
_this7._openNode(node, false, null);
|
|
998
|
+
|
|
999
|
+
return level !== maxLevel;
|
|
671
1000
|
}
|
|
1001
|
+
});
|
|
1002
|
+
|
|
1003
|
+
if (loadingCount === 0) {
|
|
1004
|
+
cbFinished();
|
|
1005
|
+
}
|
|
672
1006
|
};
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
1007
|
+
|
|
1008
|
+
openNodes();
|
|
1009
|
+
};
|
|
1010
|
+
|
|
1011
|
+
if (!restoreState()) {
|
|
1012
|
+
autoOpenNodes();
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
}, {
|
|
1016
|
+
key: "getAutoOpenMaxLevel",
|
|
1017
|
+
value: function getAutoOpenMaxLevel() {
|
|
1018
|
+
if (this.options.autoOpen === true) {
|
|
1019
|
+
return -1;
|
|
1020
|
+
} else if (typeof this.options.autoOpen === "number") {
|
|
1021
|
+
return this.options.autoOpen;
|
|
1022
|
+
} else if (typeof this.options.autoOpen === "string") {
|
|
1023
|
+
return parseInt(this.options.autoOpen, 10);
|
|
1024
|
+
} else {
|
|
1025
|
+
return 0;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}, {
|
|
1029
|
+
key: "getClickTarget",
|
|
1030
|
+
value: function getClickTarget(element) {
|
|
1031
|
+
var $target = jQuery(element);
|
|
1032
|
+
var $button = $target.closest(".jqtree-toggler");
|
|
1033
|
+
|
|
1034
|
+
if ($button.length) {
|
|
1035
|
+
var _node4 = this.getNode($button);
|
|
1036
|
+
|
|
1037
|
+
if (_node4) {
|
|
1038
|
+
return {
|
|
1039
|
+
type: "button",
|
|
1040
|
+
node: _node4
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
} else {
|
|
1044
|
+
var $el = $target.closest(".jqtree-element");
|
|
1045
|
+
|
|
1046
|
+
if ($el.length) {
|
|
1047
|
+
var _node5 = this.getNode($el);
|
|
1048
|
+
|
|
1049
|
+
if (_node5) {
|
|
1050
|
+
return {
|
|
1051
|
+
type: "label",
|
|
1052
|
+
node: _node5
|
|
699
1053
|
};
|
|
700
|
-
|
|
701
|
-
};
|
|
702
|
-
if (!restoreState()) {
|
|
703
|
-
autoOpenNodes();
|
|
704
|
-
}
|
|
705
|
-
};
|
|
706
|
-
JqTreeWidget.prototype.getAutoOpenMaxLevel = function () {
|
|
707
|
-
if (this.options.autoOpen === true) {
|
|
708
|
-
return -1;
|
|
709
|
-
}
|
|
710
|
-
else if (typeof this.options.autoOpen === "number") {
|
|
711
|
-
return this.options.autoOpen;
|
|
712
|
-
}
|
|
713
|
-
else if (typeof this.options.autoOpen === "string") {
|
|
714
|
-
return parseInt(this.options.autoOpen, 10);
|
|
715
|
-
}
|
|
716
|
-
else {
|
|
717
|
-
return 0;
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
JqTreeWidget.prototype.getClickTarget = function (element) {
|
|
721
|
-
var $target = jQuery(element);
|
|
722
|
-
var $button = $target.closest(".jqtree-toggler");
|
|
723
|
-
if ($button.length) {
|
|
724
|
-
var node = this.getNode($button);
|
|
725
|
-
if (node) {
|
|
726
|
-
return {
|
|
727
|
-
type: "button",
|
|
728
|
-
node: node
|
|
729
|
-
};
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
else {
|
|
733
|
-
var $el = $target.closest(".jqtree-element");
|
|
734
|
-
if ($el.length) {
|
|
735
|
-
var node = this.getNode($el);
|
|
736
|
-
if (node) {
|
|
737
|
-
return {
|
|
738
|
-
type: "label",
|
|
739
|
-
node: node
|
|
740
|
-
};
|
|
741
|
-
}
|
|
742
|
-
}
|
|
1054
|
+
}
|
|
743
1055
|
}
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
return null;
|
|
1059
|
+
}
|
|
1060
|
+
}, {
|
|
1061
|
+
key: "getNode",
|
|
1062
|
+
value: function getNode($element) {
|
|
1063
|
+
var $li = $element.closest("li.jqtree_common");
|
|
1064
|
+
|
|
1065
|
+
if ($li.length === 0) {
|
|
744
1066
|
return null;
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
};
|
|
769
|
-
JqTreeWidget.prototype.deselectCurrentNode = function () {
|
|
770
|
-
var node = this.getSelectedNode();
|
|
771
|
-
if (node) {
|
|
772
|
-
this.removeFromSelection(node);
|
|
773
|
-
}
|
|
774
|
-
};
|
|
775
|
-
JqTreeWidget.prototype.getDefaultClosedIcon = function () {
|
|
776
|
-
if (this.options.rtl) {
|
|
777
|
-
// triangle to the left
|
|
778
|
-
return "◀";
|
|
779
|
-
}
|
|
780
|
-
else {
|
|
781
|
-
// triangle to the right
|
|
782
|
-
return "►";
|
|
783
|
-
}
|
|
784
|
-
};
|
|
785
|
-
JqTreeWidget.prototype.getRtlOption = function () {
|
|
786
|
-
if (this.options.rtl != null) {
|
|
787
|
-
return this.options.rtl;
|
|
788
|
-
}
|
|
789
|
-
else {
|
|
790
|
-
var dataRtl = this.element.data("rtl");
|
|
791
|
-
if (dataRtl !== null &&
|
|
792
|
-
dataRtl !== false &&
|
|
793
|
-
dataRtl !== undefined) {
|
|
794
|
-
return true;
|
|
795
|
-
}
|
|
796
|
-
else {
|
|
797
|
-
return false;
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
JqTreeWidget.prototype.doSelectNode = function (node, optionsParam) {
|
|
802
|
-
var _this = this;
|
|
803
|
-
var saveState = function () {
|
|
804
|
-
if (_this.options.saveState) {
|
|
805
|
-
_this.saveStateHandler.saveState();
|
|
806
|
-
}
|
|
807
|
-
};
|
|
808
|
-
if (!node) {
|
|
809
|
-
// Called with empty node -> deselect current node
|
|
810
|
-
this.deselectCurrentNode();
|
|
811
|
-
saveState();
|
|
812
|
-
return;
|
|
813
|
-
}
|
|
814
|
-
var defaultOptions = { mustSetFocus: true, mustToggle: true };
|
|
815
|
-
var selectOptions = __assign(__assign({}, defaultOptions), (optionsParam || {}));
|
|
816
|
-
var canSelect = function () {
|
|
817
|
-
if (_this.options.onCanSelectNode) {
|
|
818
|
-
return (_this.options.selectable === true &&
|
|
819
|
-
_this.options.onCanSelectNode(node));
|
|
820
|
-
}
|
|
821
|
-
else {
|
|
822
|
-
return _this.options.selectable === true;
|
|
823
|
-
}
|
|
824
|
-
};
|
|
825
|
-
var openParents = function () {
|
|
826
|
-
var parent = node.parent;
|
|
827
|
-
if (parent && parent.parent && !parent.is_open) {
|
|
828
|
-
_this.openNode(parent, false);
|
|
829
|
-
}
|
|
830
|
-
};
|
|
831
|
-
if (!canSelect()) {
|
|
832
|
-
return;
|
|
1067
|
+
} else {
|
|
1068
|
+
return $li.data("node");
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}, {
|
|
1072
|
+
key: "saveState",
|
|
1073
|
+
value: function saveState() {
|
|
1074
|
+
if (this.options.saveState) {
|
|
1075
|
+
this.saveStateHandler.saveState();
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
}, {
|
|
1079
|
+
key: "selectCurrentNode",
|
|
1080
|
+
value: function selectCurrentNode(mustSetFocus) {
|
|
1081
|
+
var node = this.getSelectedNode();
|
|
1082
|
+
|
|
1083
|
+
if (node) {
|
|
1084
|
+
var nodeElement = this._getNodeElementForNode(node);
|
|
1085
|
+
|
|
1086
|
+
if (nodeElement) {
|
|
1087
|
+
nodeElement.select(mustSetFocus);
|
|
833
1088
|
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
}, {
|
|
1092
|
+
key: "deselectCurrentNode",
|
|
1093
|
+
value: function deselectCurrentNode() {
|
|
1094
|
+
var node = this.getSelectedNode();
|
|
1095
|
+
|
|
1096
|
+
if (node) {
|
|
1097
|
+
this.removeFromSelection(node);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
}, {
|
|
1101
|
+
key: "getDefaultClosedIcon",
|
|
1102
|
+
value: function getDefaultClosedIcon() {
|
|
1103
|
+
if (this.options.rtl) {
|
|
1104
|
+
// triangle to the left
|
|
1105
|
+
return "◀";
|
|
1106
|
+
} else {
|
|
1107
|
+
// triangle to the right
|
|
1108
|
+
return "►";
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
}, {
|
|
1112
|
+
key: "getRtlOption",
|
|
1113
|
+
value: function getRtlOption() {
|
|
1114
|
+
if (this.options.rtl != null) {
|
|
1115
|
+
return this.options.rtl;
|
|
1116
|
+
} else {
|
|
1117
|
+
var dataRtl = this.element.data("rtl");
|
|
1118
|
+
|
|
1119
|
+
if (dataRtl !== null && dataRtl !== false && dataRtl !== undefined) {
|
|
1120
|
+
return true;
|
|
1121
|
+
} else {
|
|
1122
|
+
return false;
|
|
842
1123
|
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
}, {
|
|
1127
|
+
key: "doSelectNode",
|
|
1128
|
+
value: function doSelectNode(node, optionsParam) {
|
|
1129
|
+
var _this8 = this;
|
|
1130
|
+
|
|
1131
|
+
var saveState = function saveState() {
|
|
1132
|
+
if (_this8.options.saveState) {
|
|
1133
|
+
_this8.saveStateHandler.saveState();
|
|
852
1134
|
}
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
if (!node) {
|
|
1138
|
+
// Called with empty node -> deselect current node
|
|
1139
|
+
this.deselectCurrentNode();
|
|
853
1140
|
saveState();
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
this.dndHandler.refresh();
|
|
870
|
-
}
|
|
1141
|
+
return;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
var defaultOptions = {
|
|
1145
|
+
mustSetFocus: true,
|
|
1146
|
+
mustToggle: true
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
var selectOptions = _objectSpread(_objectSpread({}, defaultOptions), optionsParam || {});
|
|
1150
|
+
|
|
1151
|
+
var canSelect = function canSelect() {
|
|
1152
|
+
if (_this8.options.onCanSelectNode) {
|
|
1153
|
+
return _this8.options.selectable === true && _this8.options.onCanSelectNode(node);
|
|
1154
|
+
} else {
|
|
1155
|
+
return _this8.options.selectable === true;
|
|
871
1156
|
}
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
var openParents = function openParents() {
|
|
1160
|
+
var parent = node.parent;
|
|
1161
|
+
|
|
1162
|
+
if (parent && parent.parent && !parent.is_open) {
|
|
1163
|
+
_this8.openNode(parent, false);
|
|
878
1164
|
}
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
if (!canSelect()) {
|
|
1168
|
+
return;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
if (this.selectNodeHandler.isNodeSelected(node)) {
|
|
1172
|
+
if (selectOptions.mustToggle) {
|
|
1173
|
+
this.deselectCurrentNode();
|
|
1174
|
+
|
|
1175
|
+
this._triggerEvent("tree.select", {
|
|
1176
|
+
node: null,
|
|
1177
|
+
previous_node: node
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
} else {
|
|
1181
|
+
var deselectedNode = this.getSelectedNode() || null;
|
|
1182
|
+
this.deselectCurrentNode();
|
|
1183
|
+
this.addToSelection(node, selectOptions.mustSetFocus);
|
|
1184
|
+
|
|
1185
|
+
this._triggerEvent("tree.select", {
|
|
1186
|
+
node: node,
|
|
1187
|
+
deselected_node: deselectedNode
|
|
896
1188
|
});
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
}
|
|
1189
|
+
|
|
1190
|
+
openParents();
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
saveState();
|
|
1194
|
+
}
|
|
1195
|
+
}, {
|
|
1196
|
+
key: "doLoadData",
|
|
1197
|
+
value: function doLoadData(data, parentNode) {
|
|
1198
|
+
if (!data) {
|
|
1199
|
+
return;
|
|
1200
|
+
} else {
|
|
1201
|
+
this._triggerEvent("tree.load_data", {
|
|
1202
|
+
tree_data: data
|
|
1203
|
+
});
|
|
1204
|
+
|
|
1205
|
+
if (parentNode) {
|
|
1206
|
+
this.deselectNodes(parentNode);
|
|
1207
|
+
this.loadSubtree(data, parentNode);
|
|
1208
|
+
} else {
|
|
1209
|
+
this.initTree(data);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
if (this.isDragging()) {
|
|
1213
|
+
this.dndHandler.refresh();
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
}, {
|
|
1218
|
+
key: "deselectNodes",
|
|
1219
|
+
value: function deselectNodes(parentNode) {
|
|
1220
|
+
var selectedNodesUnderParent = this.selectNodeHandler.getSelectedNodesUnder(parentNode);
|
|
1221
|
+
|
|
1222
|
+
var _iterator = _createForOfIteratorHelper(selectedNodesUnderParent),
|
|
1223
|
+
_step;
|
|
1224
|
+
|
|
1225
|
+
try {
|
|
1226
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
1227
|
+
var n = _step.value;
|
|
1228
|
+
this.selectNodeHandler.removeFromSelection(n);
|
|
1229
|
+
}
|
|
1230
|
+
} catch (err) {
|
|
1231
|
+
_iterator.e(err);
|
|
1232
|
+
} finally {
|
|
1233
|
+
_iterator.f();
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
}, {
|
|
1237
|
+
key: "loadSubtree",
|
|
1238
|
+
value: function loadSubtree(data, parentNode) {
|
|
1239
|
+
parentNode.loadFromData(data);
|
|
1240
|
+
parentNode.load_on_demand = false;
|
|
1241
|
+
parentNode.is_loading = false;
|
|
1242
|
+
|
|
1243
|
+
this._refreshElements(parentNode);
|
|
1244
|
+
}
|
|
1245
|
+
}, {
|
|
1246
|
+
key: "doLoadDataFromUrl",
|
|
1247
|
+
value: function doLoadDataFromUrl(urlInfoParam, parentNode, onFinished) {
|
|
1248
|
+
var urlInfo = urlInfoParam || this.getDataUrlInfo(parentNode);
|
|
1249
|
+
this.dataLoader.loadFromUrl(urlInfo, parentNode, onFinished);
|
|
1250
|
+
}
|
|
1251
|
+
}, {
|
|
1252
|
+
key: "loadFolderOnDemand",
|
|
1253
|
+
value: function loadFolderOnDemand(node) {
|
|
1254
|
+
var _this9 = this;
|
|
1255
|
+
|
|
1256
|
+
var slide = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
1257
|
+
var onFinished = arguments.length > 2 ? arguments[2] : undefined;
|
|
1258
|
+
node.is_loading = true;
|
|
1259
|
+
this.doLoadDataFromUrl(null, node, function () {
|
|
1260
|
+
_this9._openNode(node, slide, onFinished);
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
}]);
|
|
1264
|
+
|
|
1265
|
+
return JqTreeWidget;
|
|
1266
|
+
}(_mouse["default"]);
|
|
1267
|
+
|
|
938
1268
|
exports.JqTreeWidget = JqTreeWidget;
|
|
939
|
-
|
|
1269
|
+
|
|
1270
|
+
_defineProperty(JqTreeWidget, "defaults", {
|
|
1271
|
+
animationSpeed: "fast",
|
|
1272
|
+
autoEscape: true,
|
|
1273
|
+
autoOpen: false,
|
|
1274
|
+
// true / false / int (open n levels starting at 0)
|
|
1275
|
+
buttonLeft: true,
|
|
1276
|
+
// The symbol to use for a closed node - ► BLACK RIGHT-POINTING POINTER
|
|
1277
|
+
// http://www.fileformat.info/info/unicode/char/25ba/index.htm
|
|
1278
|
+
closedIcon: undefined,
|
|
1279
|
+
data: undefined,
|
|
1280
|
+
dataFilter: undefined,
|
|
1281
|
+
dataUrl: undefined,
|
|
1282
|
+
dragAndDrop: false,
|
|
1283
|
+
keyboardSupport: true,
|
|
1284
|
+
nodeClass: _node6.Node,
|
|
1285
|
+
onCanMove: undefined,
|
|
1286
|
+
// Can this node be moved?
|
|
1287
|
+
onCanMoveTo: undefined,
|
|
1288
|
+
// Can this node be moved to this position? function(moved_node, target_node, position)
|
|
1289
|
+
onCanSelectNode: undefined,
|
|
1290
|
+
onCreateLi: undefined,
|
|
1291
|
+
onDragMove: undefined,
|
|
1292
|
+
onDragStop: undefined,
|
|
1293
|
+
onGetStateFromStorage: undefined,
|
|
1294
|
+
onIsMoveHandle: undefined,
|
|
1295
|
+
onLoadFailed: undefined,
|
|
1296
|
+
onLoading: undefined,
|
|
1297
|
+
onSetStateFromStorage: undefined,
|
|
1298
|
+
openedIcon: "▼",
|
|
1299
|
+
openFolderDelay: 500,
|
|
1300
|
+
// The delay for opening a folder during drag and drop; the value is in milliseconds
|
|
1301
|
+
// The symbol to use for an open node - ▼ BLACK DOWN-POINTING TRIANGLE
|
|
1302
|
+
// http://www.fileformat.info/info/unicode/char/25bc/index.htm
|
|
1303
|
+
rtl: undefined,
|
|
1304
|
+
// right-to-left support; true / false (default)
|
|
1305
|
+
saveState: false,
|
|
1306
|
+
// true / false / string (cookie name)
|
|
1307
|
+
selectable: true,
|
|
1308
|
+
showEmptyFolder: false,
|
|
1309
|
+
slide: true,
|
|
1310
|
+
// must display slide animation?
|
|
1311
|
+
startDndDelay: 300,
|
|
1312
|
+
// The delay for starting dnd (in milliseconds)
|
|
1313
|
+
tabIndex: 0,
|
|
1314
|
+
useContextMenu: true
|
|
1315
|
+
});
|
|
1316
|
+
|
|
1317
|
+
_simple["default"].register(JqTreeWidget, "tree");
|