Skip to content

Commit

Permalink
fix for get_node not working with anchors with IDs - close #863
Browse files Browse the repository at this point in the history
  • Loading branch information
vakata committed Oct 15, 2014
1 parent bcefefe commit dc1c9ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion dist/jstree.js
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,10 @@
if(this._model.data[obj]) {
obj = this._model.data[obj];
}
else if(((dom = $(obj, this.element)).length || (dom = $('#' + obj.replace($.jstree.idregex,'\\$&'), this.element)).length) && this._model.data[dom.closest('.jstree-node').attr('id')]) {
else if(typeof obj === "string" && (dom = $('#' + obj.replace($.jstree.idregex,'\\$&'), this.element)).length && this._model.data[dom.closest('.jstree-node').attr('id')]) {
obj = this._model.data[dom.closest('.jstree-node').attr('id')];
}
else if((dom = $(obj, this.element)).length && this._model.data[dom.closest('.jstree-node').attr('id')]) {
obj = this._model.data[dom.closest('.jstree-node').attr('id')];
}
else if((dom = $(obj, this.element)).length && dom.hasClass('jstree')) {
Expand Down
Loading

0 comments on commit dc1c9ba

Please sign in to comment.