mirror of
https://github.com/overte-org/overte.git
synced 2025-04-09 19:02:43 +02:00
35 lines
952 B
JavaScript
35 lines
952 B
JavaScript
//
|
|
// goto.js
|
|
// scripts/system/
|
|
//
|
|
// Created by Howard Stearns on 2 Jun 2016
|
|
// Copyright 2016 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
|
|
|
|
|
var button = toolBar.addButton({
|
|
objectName: "goto",
|
|
imageURL: Script.resolvePath("assets/images/tools/directory.svg"),
|
|
visible: true,
|
|
buttonState: 1,
|
|
alpha: 0.9,
|
|
});
|
|
|
|
function onAddressBarShown(visible) {
|
|
button.writeProperty('buttonState', visible ? 0 : 1);
|
|
}
|
|
function onClicked(){
|
|
DialogsManager.toggleAddressBar();
|
|
}
|
|
button.clicked.connect(onClicked);
|
|
DialogsManager.addressBarShown.connect(onAddressBarShown);
|
|
|
|
Script.scriptEnding.connect(function () {
|
|
button.clicked.disconnect(onClicked);
|
|
DialogsManager.addressBarShown.disconnect(onAddressBarShown);
|
|
});
|