From b977b5a8dba9e53ac32324c43ae9ad8a9aded910 Mon Sep 17 00:00:00 2001
From: Tira Odhner <atiraodhner@gmail.com>
Date: Thu, 16 Mar 2017 22:39:00 -0400
Subject: [PATCH] Stop using a global variable for the tree node when
 calculating the hierarchy.

---
 web/pgadmin/browser/templates/browser/js/node.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/web/pgadmin/browser/templates/browser/js/node.js b/web/pgadmin/browser/templates/browser/js/node.js
index 7b2b5d3..e0a59f2 100644
--- a/web/pgadmin/browser/templates/browser/js/node.js
+++ b/web/pgadmin/browser/templates/browser/js/node.js
@@ -1444,16 +1444,16 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
     getTreeNodeHierarchy: function(i) {
       var idx = 0,
           res = {},
-          t = pgBrowser.tree;
+          tree = pgBrowser.tree;
       do {
-        d = t.itemData(i);
-        if (d._type in pgBrowser.Nodes && pgBrowser.Nodes[d._type].hasId) {
-          res[d._type] = _.extend({}, d, {
+        var item = tree.itemData(i);
+        if (item._type in pgBrowser.Nodes && pgBrowser.Nodes[item._type].hasId) {
+          res[item._type] = _.extend({}, item, {
             'priority': idx
           });
           idx -= 1;
         }
-        i = t.hasParent(i) ? t.parent(i) : null;
+        i = tree.hasParent(i) ? tree.parent(i) : null;
       } while (i);
 
       return res;
-- 
2.10.0

