From 2bdd449bd06e775d1a94c05eb6bfdb5ee9e01daa Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Mon, 11 Jan 2016 21:30:42 +0530 Subject: [PATCH] Changed the way - we saw the title in the panel to allow the node to decide, what to saw. --- web/pgadmin/browser/templates/browser/js/node.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/web/pgadmin/browser/templates/browser/js/node.js b/web/pgadmin/browser/templates/browser/js/node.js index 97be43657..6a839a4c9 100644 --- a/web/pgadmin/browser/templates/browser/js/node.js +++ b/web/pgadmin/browser/templates/browser/js/node.js @@ -52,7 +52,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, Backform) { // Label label: '', title: function(d) { - return d ? d.label : ''; + return o.label + (d ? (' - ' + d.label) : ''); }, hasId: true, /////// @@ -260,7 +260,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, Backform) { i = args.item || item || t.selected(), d = i && i.length == 1 ? t.itemData(i) : undefined o = this, - l = o.label + ' - ' + o.title(d); + l = o.title.apply(this, [d]); // Make sure - the properties dialog type registered pgBrowser.Node.register_node_panel(); @@ -785,7 +785,17 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, Backform) { }, updateTreeItem = function() { // Update the item lable (if lable is modified.) - tree.setLabel(item, {label: view.model.get("name")}); + if (view.model.tnode) { + var itemData = tree.itemData(item), + icon = itemData.icon; + + tree.removeIcon(item); + _.extend(itemData, {icon: icon}, view.model.tnode); + tree.setLabel(item, {label: itemData.label}); + tree.addIcon(item, {icon: itemData.icon}); + } else if (view.model.get('name')) { + tree.setLabel(item, {label: view.model.get("name")}); + } panel.$container.removeAttr('action-mode'); setTimeout(function() { closePanel(); }, 0); },