Ensure browser toolbar buttons are always shown.

This commit is contained in:
Aditya Toshniwal 2018-12-03 10:09:36 +00:00 committed by Dave Page
parent 9a3047c89c
commit 851c0cfff3

View File

@ -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