aboutsummaryrefslogtreecommitdiff
path: root/app/src/web/ts/menu.ts
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/web/ts/menu.ts')
-rw-r--r--app/src/web/ts/menu.ts48
1 files changed, 9 insertions, 39 deletions
diff --git a/app/src/web/ts/menu.ts b/app/src/web/ts/menu.ts
index b26e9cc9..5b3e6fa9 100644
--- a/app/src/web/ts/menu.ts
+++ b/app/src/web/ts/menu.ts
@@ -1,4 +1,4 @@
-// Click menu and move contents to main view
+// Click menu after delay and notify
(function () {
const viewport = document.querySelector("#viewport");
const root = document.querySelector("#root");
@@ -20,43 +20,13 @@
return
}
- /*
- * Required to remove height restrictions
- */
- const y = new MutationObserver(() => {
- viewport.removeAttribute('style');
- root.removeAttribute('style');
- });
-
- y.observe(viewport, {
- attributes: true
- });
- y.observe(root, {
- attributes: true
- });
-
- const x = new MutationObserver(() => {
- const menu = document.querySelector('.mSideMenu');
- if (menu) {
- x.disconnect();
- console.log("Found side menu");
- // Transfer elements
- while (root.firstChild) {
- root.removeChild(root.firstChild);
- }
- while (menu.childNodes.length) {
- viewport.appendChild(menu.childNodes[0]);
- }
+ // Js handling is a bit slow so we need to wait
+ setTimeout(() => {
+ menuA.click();
+ console.log("Menu setup clicked");
+ // Reaction is also slow so we need to wait
+ setTimeout(() => {
Frost.emit(0);
- setTimeout(() => {
- y.disconnect();
- console.log('Unhook styler');
- }, 500);
- }
- });
- x.observe(jewel, {
- childList: true,
- subtree: true
- });
- menuA.click();
+ }, 100);
+ }, 500);
}).call(undefined);