Permalink
Browse files

optionally allow to configure what is used as tree root

  • Loading branch information...
1 parent c76ff50 commit a936a94d3a1f720bc528c0859e385d6c7df109e2 @dbu dbu committed Dec 16, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 jquery.treeview.async.js
@@ -1,6 +1,6 @@
/*
* Async Treeview 0.1 - Lazy-loading extension for Treeview
- *
+ *
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
*
* Copyright (c) 2007 Jörn Zaefferer
@@ -88,9 +88,12 @@ $.fn.treeview = function(settings) {
if (!settings.url) {
return proxied.apply(this, arguments);
}
+ if (!settings.root) {
+ settings.root = "source";
+ }
var container = this;
if (!container.children().size())
- load(settings, "source", this, container);
+ load(settings, settings.root, this, container);
var userToggle = settings.toggle;
return proxied.call(this, $.extend({}, settings, {
collapsed: true,
@@ -107,4 +110,4 @@ $.fn.treeview = function(settings) {
}));
};
-})(jQuery);
+})(jQuery);

0 comments on commit a936a94

Please sign in to comment.