aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js/menu.js
diff options
context:
space:
mode:
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);