You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2017/11/11 17:15:47 UTC

qpid-dispatch git commit: DISPATCH-801 Ensure there is an active node on Entities page when showing page for first time

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 844ef61b8 -> 1723015fc


DISPATCH-801 Ensure there is an active node on Entities page when showing page for first time


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/1723015f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/1723015f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/1723015f

Branch: refs/heads/master
Commit: 1723015fc18134423a7effc0716c050f6e3edeca
Parents: 844ef61
Author: Ernest Allen <ea...@redhat.com>
Authored: Sat Nov 11 12:15:23 2017 -0500
Committer: Ernest Allen <ea...@redhat.com>
Committed: Sat Nov 11 12:15:23 2017 -0500

----------------------------------------------------------------------
 console/stand-alone/plugin/js/qdrList.js | 29 +++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/1723015f/console/stand-alone/plugin/js/qdrList.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrList.js b/console/stand-alone/plugin/js/qdrList.js
index bc96b90..53e5213 100644
--- a/console/stand-alone/plugin/js/qdrList.js
+++ b/console/stand-alone/plugin/js/qdrList.js
@@ -281,7 +281,7 @@ var QDR = (function(QDR) {
         return active[0].key
       return null
     }
-    // the data for the selected entity is available, populate the tree
+    // the data for the selected entity is available, populate the tree on the left
     var updateTreeChildren = function (entity, tableRows, expand) {
       var tree = $("#entityTree").fancytree("getTree"), node;
       if (tree) {
@@ -469,6 +469,25 @@ var QDR = (function(QDR) {
         q.await(function (error) {
           if (error)
             QDR.log.error(error.message)
+
+          if (!tree.getActiveNode()) {
+            if ($scope.ActivatedKey) {
+              var node = tree.getNodeByKey($scope.ActivatedKey)
+              if (node) {
+                node.setActive(true, {noEvents: true})
+              }
+            }
+            if (!tree.getActiveNode()) {
+              var first = tree.getFirstChild()
+              if (first) {
+                var child = first.getFirstChild()
+                if (child)
+                  first = child
+              }
+              first.setActive(true)
+            }
+          }
+
           // once all expanded tree nodes have been update, schedule another update
           updateIntervalHandle = setTimeout(updateExpandedEntities, updateInterval)
         })
@@ -565,7 +584,7 @@ var QDR = (function(QDR) {
             tableRows.push(row);
           }
           tableRows.sort( function (a, b) { return a.name.value.localeCompare(b.name.value) })
-          setTimeout(selectRow, 0, {entity: dotentity, rows: tableRows, expand: expand});
+          selectRow({entity: dotentity, rows: tableRows, expand: expand});
         }
         callback(null)  // let queue handler know we are done
       }
@@ -834,12 +853,6 @@ var QDR = (function(QDR) {
 
     // this gets called once tree is initialized
     var onTreeInitialized = function (event, data) {
-      if ($scope.ActivatedKey) {
-        var node = data.tree.getNodeByKey($scope.ActivatedKey)
-        if (node) {
-          node.setActive(true, {noEvents: true})
-        }
-      }
       updateExpandedEntities();
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org