From bbac9a5c189f73b47017a1be86a8722d67ea0f37 Mon Sep 17 00:00:00 2001 From: Tira Odhner 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 af016b5b..d47ffc74 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.12.0