Skip to content

Commit d25000d

Browse files
committed
Added tree.getRootNode()
1 parent 067597c commit d25000d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

demo/sample.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,11 @@ SAMPLE_BUTTON_DEFAULTS = {
161161
function addSampleButton(options)
162162
{
163163
var opts = $.extend({}, SAMPLE_BUTTON_DEFAULTS, options),
164-
$container;
165-
$container = $("<span />", {
166-
"class": "sampleButtonContainer"
167-
});
164+
$buttonBar = $("#sampleButtons"),
165+
$container = $("<span />", {
166+
"class": "sampleButtonContainer"
167+
});
168+
168169
$("<button />", {
169170
id: opts.id,
170171
title: opts.tooltip,
@@ -218,7 +219,7 @@ function addSampleButton(options)
218219
if( !$("#sampleButtons").length ){
219220
$.error("addSampleButton() needs a container with id #sampleButtons");
220221
}
221-
$container.appendTo($("#sampleButtons"));
222+
$container.appendTo($buttonBar);
222223
}
223224

224225

src/jquery.fancytree.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,12 @@ Fancytree.prototype = /** @lends Fancytree# */{
19771977
}, true);
19781978
return match;
19791979
},
1980-
// TODO: getRoot()
1980+
/** Return the invisible system root node.
1981+
* @returns {FancytreeNode}
1982+
*/
1983+
getRootNode: function() {
1984+
return this.rootNode;
1985+
},
19811986
/**
19821987
* Return an array of selected nodes.
19831988
* @param {boolean} [stopOnParents=false] only return the topmost selected

0 commit comments

Comments
 (0)