Skip to content

Commit

Permalink
Fix when use ext-grid in one tree, other tree not use ext-grid has er…
Browse files Browse the repository at this point in the history
…ror on click

Close #973
  • Loading branch information
mar10 committed Nov 11, 2019
1 parent 2a4215e commit cea16eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 2.33.1-0 / Unreleased
* TODO: tree.hasFocus() more reliable.
* [Fixed] #973 when use ext-grid in one tree, other tree not use ext-grid has error on click.

# 2.33.0 / 2019-10-29
* [Added] event `preInit` (fired before nodes are loaded).
Expand Down
2 changes: 1 addition & 1 deletion src/jquery.fancytree.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@
tree = node.tree,
topNode = options && options.topNode,
vp = tree.viewport,
start = vp.start;
start = vp ? vp.start : null;

if (!tree.viewport) {
return node._super.apply(this, arguments);
Expand Down
9 changes: 8 additions & 1 deletion src/jquery.fancytree.js
Original file line number Diff line number Diff line change
Expand Up @@ -2798,11 +2798,18 @@
delete this._tempCache[key];
return null;
},
/* Check if this tree has extension `name` enabled.
*
* @param {string} name name of the required extension
*/
_usesExtension: function(name) {
return $.inArray(name, this.options.extensions) >= 0;
},
/* Check if current extensions dependencies are met and throw an error if not.
*
* This method may be called inside the `treeInit` hook for custom extensions.
*
* @param {string} extension name of the required extension
* @param {string} name name of the required extension
* @param {boolean} [required=true] pass `false` if the extension is optional, but we want to check for order if it is present
* @param {boolean} [before] `true` if `name` must be included before this, `false` otherwise (use `null` if order doesn't matter)
* @param {string} [message] optional error message (defaults to a descriptve error message)
Expand Down

0 comments on commit cea16eb

Please sign in to comment.