From 2ea88012f9d215a3e0419bf2dc15a7addb39a8e5 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Thu, 16 Feb 2017 17:36:16 -0800 Subject: [PATCH] Remove toolbar from tablet-goto.js --- scripts/system/tablet-goto.js | 51 +++++++++-------------------------- 1 file changed, 12 insertions(+), 39 deletions(-) diff --git a/scripts/system/tablet-goto.js b/scripts/system/tablet-goto.js index 5283df6127..6c3e12cd9b 100644 --- a/scripts/system/tablet-goto.js +++ b/scripts/system/tablet-goto.js @@ -12,54 +12,27 @@ // (function() { // BEGIN LOCAL_SCOPE - var gotoQmlSource = "TabletAddressDialog.qml"; - var button; + var gotoQmlSource = "TabletAddressDialog.qml"; var buttonName = "GOTO"; - var toolBar = null; - var tablet = null; - function onAddressBarShown(visible) { - if (toolBar) { - button.editProperties({isActive: visible}); - } - } function onClicked(){ - if (toolBar) { - DialogsManager.toggleAddressBar(); - } else { - tablet.loadQMLSource(gotoQmlSource); - } + tablet.loadQMLSource(gotoQmlSource); } - if (Settings.getValue("HUDUIEnabled")) { - toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); - button = toolBar.addButton({ - objectName: buttonName, - imageURL: Script.resolvePath("assets/images/tools/directory.svg"), - visible: true, - alpha: 0.9 - }); - } else { - tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); - button = tablet.addButton({ - icon: "icons/tablet-icons/goto-i.svg", - activeIcon: "icons/tablet-icons/goto-a.svg", - text: buttonName, - sortOrder: 8 - }); - } - + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var button = tablet.addButton({ + icon: "icons/tablet-icons/goto-i.svg", + activeIcon: "icons/tablet-icons/goto-a.svg", + text: buttonName, + sortOrder: 8 + }); + button.clicked.connect(onClicked); - DialogsManager.addressBarShown.connect(onAddressBarShown); - + Script.scriptEnding.connect(function () { button.clicked.disconnect(onClicked); if (tablet) { tablet.removeButton(button); } - if (toolBar) { - toolBar.removeButton(buttonName); - } - DialogsManager.addressBarShown.disconnect(onAddressBarShown); }); - + }()); // END LOCAL_SCOPE