From 851c0cfff3a34190790498efe14ca97dc460816b Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Mon, 3 Dec 2018 10:09:36 +0000 Subject: [PATCH] Ensure browser toolbar buttons are always shown. --- web/pgadmin/browser/static/js/toolbar.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/browser/static/js/toolbar.js b/web/pgadmin/browser/static/js/toolbar.js index fc0d062cd..aef462849 100644 --- a/web/pgadmin/browser/static/js/toolbar.js +++ b/web/pgadmin/browser/static/js/toolbar.js @@ -41,7 +41,11 @@ let _otherToolbarButtons = []; // This function is used to add button into the browser panel. function registerToolBarButton(btn) { - if (!(btn.label in _toolbarButtons)) { + /* Sometimes the panel onCreate is called two times. + * Add buttons if not present in the panel also. + */ + if (!(btn.label in _toolbarButtons) + || (_.findIndex(_browserPanel._buttonList,{name:btn.label}) < 0)) { _browserPanel.addButton( btn.label, btn.btnClass, btn.text, btn.label, btn.toggled, btn.toggleClass, btn.parentClass, btn.enabled