tweak to how apps tree is loaded, to permit other types of trees to be dropped 
in


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/9e0307a1
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/9e0307a1
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/9e0307a1

Branch: refs/heads/0.6.0
Commit: 9e0307a1dcb02f0a2c15515657106037071dd112
Parents: 46b5702
Author: Alex Heneveld <[email protected]>
Authored: Sun Sep 15 21:06:54 2013 +0100
Committer: Alex Heneveld <[email protected]>
Committed: Wed Sep 18 09:30:05 2013 +0100

----------------------------------------------------------------------
 .../webapp/assets/js/view/application-explorer.js   |  2 +-
 .../main/webapp/assets/js/view/application-tree.js  | 16 ++++++++++------
 .../jsgui/src/main/webapp/assets/tpl/apps/page.html |  4 +---
 .../src/main/webapp/assets/tpl/apps/tree-empty.html |  7 +++++++
 4 files changed, 19 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/9e0307a1/usage/jsgui/src/main/webapp/assets/js/view/application-explorer.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/view/application-explorer.js 
b/usage/jsgui/src/main/webapp/assets/js/view/application-explorer.js
index 044ae02..d6837e7 100644
--- a/usage/jsgui/src/main/webapp/assets/js/view/application-explorer.js
+++ b/usage/jsgui/src/main/webapp/assets/js/view/application-explorer.js
@@ -28,7 +28,7 @@ define([
             this.treeView = new ApplicationTreeView({
                 collection:this.collection
             })
-            this.$('div#tree-list').html(this.treeView.render().el)
+            this.$('div#app-tree').html(this.treeView.render().el)
             this.treeView.render()
         },
         beforeClose:function () {

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/9e0307a1/usage/jsgui/src/main/webapp/assets/js/view/application-tree.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/view/application-tree.js 
b/usage/jsgui/src/main/webapp/assets/js/view/application-tree.js
index ea5851f..9c19997 100644
--- a/usage/jsgui/src/main/webapp/assets/js/view/application-tree.js
+++ b/usage/jsgui/src/main/webapp/assets/js/view/application-tree.js
@@ -5,17 +5,15 @@
 define([
     "underscore", "jquery", "backbone",
     "model/app-tree", "./entity-details", "model/entity-summary", 
"model/application",
-    "text!tpl/apps/tree-item.html", "text!tpl/apps/details.html", 
"text!tpl/apps/entity-not-found.html"
+    "text!tpl/apps/tree-item.html", "text!tpl/apps/tree-empty.html", 
"text!tpl/apps/details.html", "text!tpl/apps/entity-not-found.html"
 ], function (_, $, Backbone,
              AppTree, EntityDetailsView, EntitySummary, Application,
-             TreeItemHtml, EntityDetailsEmptyHtml, EntityNotFoundHtml) {
+             TreeItemHtml, TreeEmptyHtml, EntityDetailsEmptyHtml, 
EntityNotFoundHtml) {
 
     var treeViewTemplate = _.template(TreeItemHtml),
         notFoundTemplate = _.template(EntityNotFoundHtml);
 
     var ApplicationTreeView = Backbone.View.extend({
-        tagName: "ol",
-        className: "tree applications",
         template: treeViewTemplate,
 
         events:{
@@ -38,10 +36,16 @@ define([
 
             // Display tree and highlight the selected entity.
             if (this.collection.isEmpty()) {
-                this.$el.append("<li><i>No applications</i></li>")
+                that.$el.append(_.template(TreeEmptyHtml))
             } else {
+                that.$el.append(
+                        '<div class="navbar_main_wrapper treelist cssninja">'+
+                        '<div id="tree-list" class="navbar_main treelist">'+
+                        '<ol class="tree applications"/>');
+                var node = $('ol.tree.applications', that.$el);
+                
                 this.collection.each(function (app) {
-                    that.$el.append(that.buildTree(app))
+                    node.append(that.buildTree(app))
                 })
             }
             this.highlightEntity();

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/9e0307a1/usage/jsgui/src/main/webapp/assets/tpl/apps/page.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/apps/page.html 
b/usage/jsgui/src/main/webapp/assets/tpl/apps/page.html
index a4e33f7..73ab645 100644
--- a/usage/jsgui/src/main/webapp/assets/tpl/apps/page.html
+++ b/usage/jsgui/src/main/webapp/assets/tpl/apps/page.html
@@ -8,9 +8,7 @@
                                <i class="icon-br-refresh 
application-tree-refresh handy" />
                        </div>
                </div>
-               <div class="navbar_main_wrapper cssninja">
-                 <div id="tree-list" class="navbar_main"></div>
-               </div>
+               <div id="app-tree"></div>
        </div>
 
        <div class="span8" id="details"></div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/9e0307a1/usage/jsgui/src/main/webapp/assets/tpl/apps/tree-empty.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/apps/tree-empty.html 
b/usage/jsgui/src/main/webapp/assets/tpl/apps/tree-empty.html
new file mode 100644
index 0000000..1d908eb
--- /dev/null
+++ b/usage/jsgui/src/main/webapp/assets/tpl/apps/tree-empty.html
@@ -0,0 +1,7 @@
+<div class="navbar_main_wrapper">
+    <div class="navbar_main">
+        <div style="padding-left: 12px; padding-top: 12px; padding-bottom: 
300px;">
+            <i>No applications</i>
+        </div>
+    </div>
+</div>

Reply via email to