aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js/menu.js
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-02-02 00:39:48 -0500
committerAllan Wang <me@allanwang.ca>2019-02-02 00:39:48 -0500
commitc484c2728c1688ed695205a420eba3f2b2ba179d (patch)
tree045f471346aadb43a757389b9d39648d3ed39818 /app/src/main/assets/js/menu.js
parent459359672b1f4266bc0f009c35f246fd90cce36a (diff)
downloadfrost-c484c2728c1688ed695205a420eba3f2b2ba179d.tar.gz
frost-c484c2728c1688ed695205a420eba3f2b2ba179d.tar.bz2
frost-c484c2728c1688ed695205a420eba3f2b2ba179d.zip
Add checks to fast fail menu
Diffstat (limited to 'app/src/main/assets/js/menu.js')
-rw-r--r--app/src/main/assets/js/menu.js40
1 files changed, 26 insertions, 14 deletions
diff --git a/app/src/main/assets/js/menu.js b/app/src/main/assets/js/menu.js
index bfdca4a3..5464865c 100644
--- a/app/src/main/assets/js/menu.js
+++ b/app/src/main/assets/js/menu.js
@@ -1,6 +1,5 @@
-"use strict";
-
-(function () {
+// Generated by CoffeeScript 2.3.2
+(function() {
// click menu and move contents to main view
var jewel, menuA, root, viewport, x, y;
@@ -8,15 +7,33 @@
root = document.querySelector("#root");
+ menuA = document.querySelector("#bookmarks_jewel").querySelector("a");
+
if (!viewport) {
console.log("Menu.js: viewport is null");
+ if (typeof Frost !== "undefined" && Frost !== null) {
+ Frost.emit(0);
+ }
+ return;
}
if (!root) {
console.log("Menu.js: root is null");
+ if (typeof Frost !== "undefined" && Frost !== null) {
+ Frost.emit(0);
+ }
+ return;
}
- y = new MutationObserver(function (mutations) {
+ if (!menuA) {
+ console.log("Menu.js: jewel is null");
+ if (typeof Frost !== "undefined" && Frost !== null) {
+ Frost.emit(0);
+ }
+ return;
+ }
+
+ y = new MutationObserver(function() {
viewport.removeAttribute("style");
root.removeAttribute("style");
});
@@ -29,7 +46,7 @@
attributes: true
});
- x = new MutationObserver(function () {
+ x = new MutationObserver(function() {
var menu;
menu = document.querySelector(".mSideMenu");
if (menu !== null) {
@@ -45,10 +62,10 @@
if (typeof Frost !== "undefined" && Frost !== null) {
Frost.emit(0);
}
- setTimeout(function () {
+ setTimeout((function() {
y.disconnect();
console.log("Unhook styler");
- }, 500);
+ }), 500);
}
});
@@ -63,11 +80,6 @@
subtree: true
});
- menuA = document.querySelector("#bookmarks_jewel").querySelector("a");
-
- if (!menuA) {
- console.log("Menu.js: jewel is null");
- }
-
menuA.click();
-}).call(undefined); \ No newline at end of file
+
+}).call(this);