mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 18:18:02 +02:00
Make toolbar icon close dialog if it's open
This commit is contained in:
parent
813a5684e3
commit
b8de31db12
1 changed files with 11 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
||||||
APP_ICON_INACTIVE = "icons/tablet-icons/edit-i.svg", // FIXME: Record icon.
|
APP_ICON_INACTIVE = "icons/tablet-icons/edit-i.svg", // FIXME: Record icon.
|
||||||
APP_ICON_ACTIVE = "icons/tablet-icons/edit-a.svg", // FIXME: Record icon.
|
APP_ICON_ACTIVE = "icons/tablet-icons/edit-a.svg", // FIXME: Record icon.
|
||||||
APP_URL = Script.resolvePath("html/record.html"),
|
APP_URL = Script.resolvePath("html/record.html"),
|
||||||
|
isDialogDisplayed = false,
|
||||||
isRecordingEnabled = false,
|
isRecordingEnabled = false,
|
||||||
isRecording = false,
|
isRecording = false,
|
||||||
tablet,
|
tablet,
|
||||||
|
@ -57,6 +58,7 @@
|
||||||
startRecording();
|
startRecording();
|
||||||
button.editProperties({ isActive: isRecordingEnabled || isRecording });
|
button.editProperties({ isActive: isRecordingEnabled || isRecording });
|
||||||
}
|
}
|
||||||
|
isDialogDisplayed = false;
|
||||||
} else if (type === "Web" && url.slice(-RECORD_URL.length) === RECORD_URL) {
|
} else if (type === "Web" && url.slice(-RECORD_URL.length) === RECORD_URL) {
|
||||||
// Finish recording if is recording.
|
// Finish recording if is recording.
|
||||||
if (isRecording) {
|
if (isRecording) {
|
||||||
|
@ -68,6 +70,7 @@
|
||||||
|
|
||||||
function onTabletShownChanged() {
|
function onTabletShownChanged() {
|
||||||
// Open/close tablet.
|
// Open/close tablet.
|
||||||
|
isDialogDisplayed = false;
|
||||||
|
|
||||||
if (!tablet.tabletShown) {
|
if (!tablet.tabletShown) {
|
||||||
// Start recording if recording is enabled.
|
// Start recording if recording is enabled.
|
||||||
|
@ -106,7 +109,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function onButtonClicked() {
|
function onButtonClicked() {
|
||||||
tablet.gotoWebScreen(APP_URL);
|
if (isDialogDisplayed) {
|
||||||
|
// Can click icon in toolbar mode; gotoHomeScreen() closes dialog.
|
||||||
|
tablet.gotoHomeScreen();
|
||||||
|
isDialogDisplayed = false;
|
||||||
|
} else {
|
||||||
|
tablet.gotoWebScreen(APP_URL);
|
||||||
|
isDialogDisplayed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
|
|
Loading…
Reference in a new issue