Fixed variable scope issue in server.js

This commit is contained in:
Harshal Dhumal 2016-05-10 18:16:08 +05:30 committed by Akshay Joshi
parent 83b6a04763
commit 180630ce0e

View File

@ -81,11 +81,11 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
callbacks: { callbacks: {
/* Connect the server */ /* Connect the server */
connect_server: function(args){ connect_server: function(args){
var input = args || {}; var input = args || {},
obj = this, obj = this,
t = pgBrowser.tree, t = pgBrowser.tree,
i = input.item || t.selected(), i = input.item || t.selected(),
d = i && i.length == 1 ? t.itemData(i) : undefined; d = i && i.length == 1 ? t.itemData(i) : undefined;
if (!d) if (!d)
return false; return false;
@ -95,11 +95,11 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
}, },
/* Disconnect the server */ /* Disconnect the server */
disconnect_server: function(args) { disconnect_server: function(args) {
var input = args || {}; var input = args || {},
obj = this, obj = this,
t = pgBrowser.tree, t = pgBrowser.tree,
i = 'item' in input ? input.item : t.selected(), i = 'item' in input ? input.item : t.selected(),
d = i && i.length == 1 ? t.itemData(i) : undefined; d = i && i.length == 1 ? t.itemData(i) : undefined;
if (!d) if (!d)
return false; return false;