mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-17 11:38:45 +02:00
Merge pull request #9499 from fayeli/toggle-users-js
Porting Users.js into Tablet
This commit is contained in:
commit
de2335b13b
1 changed files with 20 additions and 0 deletions
|
@ -12,6 +12,19 @@
|
|||
//
|
||||
|
||||
(function() { // BEGIN LOCAL_SCOPE
|
||||
var MENU_ITEM = "Users Online";
|
||||
// create tablet button
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
var button = tablet.addButton({
|
||||
icon: "icons/tablet-icons/people-i.svg",
|
||||
text: "Users",
|
||||
isActive: Menu.isOptionChecked(MENU_ITEM)
|
||||
});
|
||||
function onClicked() {
|
||||
Menu.setIsOptionChecked(MENU_ITEM, !Menu.isOptionChecked(MENU_ITEM));
|
||||
button.editProperties({isActive: Menu.isOptionChecked(MENU_ITEM)});
|
||||
}
|
||||
button.clicked.connect(onClicked);
|
||||
|
||||
// resolve these paths immediately
|
||||
var MIN_MAX_BUTTON_SVG = Script.resolvePath("assets/images/tools/min-max-toggle.svg");
|
||||
|
@ -1234,4 +1247,11 @@ var usersWindow = (function () {
|
|||
Script.scriptEnding.connect(tearDown);
|
||||
}());
|
||||
|
||||
function cleanup () {
|
||||
//remove tablet button
|
||||
button.clicked.disconnect(onClicked);
|
||||
tablet.removeButton(button);
|
||||
}
|
||||
Script.scriptEnding.connect(cleanup);
|
||||
|
||||
}()); // END LOCAL_SCOPE
|
||||
|
|
Loading…
Reference in a new issue