Skip to content

Commit cea16eb

Browse files
committed
Fix when use ext-grid in one tree, other tree not use ext-grid has error on click
Close mar10#973
1 parent 2a4215e commit cea16eb

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 2.33.1-0 / Unreleased
22
* TODO: tree.hasFocus() more reliable.
3+
* [Fixed] #973 when use ext-grid in one tree, other tree not use ext-grid has error on click.
34

45
# 2.33.0 / 2019-10-29
56
* [Added] event `preInit` (fired before nodes are loaded).

src/jquery.fancytree.grid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@
617617
tree = node.tree,
618618
topNode = options && options.topNode,
619619
vp = tree.viewport,
620-
start = vp.start;
620+
start = vp ? vp.start : null;
621621

622622
if (!tree.viewport) {
623623
return node._super.apply(this, arguments);

src/jquery.fancytree.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2798,11 +2798,18 @@
27982798
delete this._tempCache[key];
27992799
return null;
28002800
},
2801+
/* Check if this tree has extension `name` enabled.
2802+
*
2803+
* @param {string} name name of the required extension
2804+
*/
2805+
_usesExtension: function(name) {
2806+
return $.inArray(name, this.options.extensions) >= 0;
2807+
},
28012808
/* Check if current extensions dependencies are met and throw an error if not.
28022809
*
28032810
* This method may be called inside the `treeInit` hook for custom extensions.
28042811
*
2805-
* @param {string} extension name of the required extension
2812+
* @param {string} name name of the required extension
28062813
* @param {boolean} [required=true] pass `false` if the extension is optional, but we want to check for order if it is present
28072814
* @param {boolean} [before] `true` if `name` must be included before this, `false` otherwise (use `null` if order doesn't matter)
28082815
* @param {string} [message] optional error message (defaults to a descriptve error message)

0 commit comments

Comments
 (0)