summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxzilla2007-09-04 15:25:18 +0000
committerxzilla2007-09-04 15:25:18 +0000
commit1aeed05fa7cf099fc952aa012526eea1963e1988 (patch)
tree03897d19d6c9e38f48c8d25d23331ba216aa170e
parent93a3e0bd71664ad4bcd6513be29751886419009c (diff)
auto expand a node in the tree (browser) if there's no other node. patch from Tomasz Pala
-rw-r--r--CREDITS2
-rw-r--r--HISTORY1
-rw-r--r--xloadtree/xloadtree2.js8
3 files changed, 10 insertions, 1 deletions
diff --git a/CREDITS b/CREDITS
index 85c7ddb2..7f6e774c 100644
--- a/CREDITS
+++ b/CREDITS
@@ -61,6 +61,8 @@ Contributors
- Eric Kinolik
- John Jawed
- JGuillaume 'ioguix' De Rorthais
+- Karl O. Pinc
+- Tomasz Pala
Third Party Libraries
diff --git a/HISTORY b/HISTORY
index 08f16620..55bab5e6 100644
--- a/HISTORY
+++ b/HISTORY
@@ -12,6 +12,7 @@ Features
* Pagination selection available for reports
* You can configure reports db, schema and table names
* Add support for creating a table using an exsting one (ioguix)
+* Auto-expand a node in the tree browser if there are no other nodes (Tomasz Pala)
Bugs
* Fix inability to assign a field type/domain of a different schema
diff --git a/xloadtree/xloadtree2.js b/xloadtree/xloadtree2.js
index 87dbc6d1..b36eed7e 100644
--- a/xloadtree/xloadtree2.js
+++ b/xloadtree/xloadtree2.js
@@ -405,13 +405,19 @@ WebFXLoadTree.documentLoaded = function (jsNode) {
var count = 0;
var cs = root.childNodes;
var l = cs.length;
+ var newNode;
for (var i = 0; i < l; i++) {
if (cs[i].tagName == "tree") {
- jsNode.add(WebFXLoadTree.createItemFromElement(cs[i]));
+ newNode=WebFXLoadTree.createItemFromElement(cs[i]);
+ jsNode.add(newNode);
count++;
}
}
+ if (count == 1 && newNode.childNodes.length) {
+ var parent=jsNode.parentNode;
+ newNode.setExpanded(true);
+ }
// if no children we got an error
if (count == 0) {
jsNode.errorText = webFXTreeConfig.errorLoadingText + " " + jsNode.src + " (???)";