diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-25 14:30:49 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-25 14:30:49 -0700 |
commit | f35939ce42ca9244468434f93dbd705e02911623 (patch) | |
tree | f473434ce37f4844e288489452d1773c03511736 /app/src/main/assets/js/menu.js | |
parent | e502ea8cd77357c1e9a6680d912252524f2950f0 (diff) | |
download | frost-f35939ce42ca9244468434f93dbd705e02911623.tar.gz frost-f35939ce42ca9244468434f93dbd705e02911623.tar.bz2 frost-f35939ce42ca9244468434f93dbd705e02911623.zip |
Test kau update
Diffstat (limited to 'app/src/main/assets/js/menu.js')
-rw-r--r-- | app/src/main/assets/js/menu.js | 74 |
1 files changed, 36 insertions, 38 deletions
diff --git a/app/src/main/assets/js/menu.js b/app/src/main/assets/js/menu.js index 4a39a93b..458d9edf 100644 --- a/app/src/main/assets/js/menu.js +++ b/app/src/main/assets/js/menu.js @@ -1,38 +1,36 @@ -if (document.querySelector('#mJewelNav') !== null) { - console.log('Fetching menu'); - var viewport = document.querySelector('#viewport'); - var root = document.querySelector('#root'); - var y = new MutationObserver(function(mutations) { - viewport.removeAttribute('style'); - root.removeAttribute('style'); - }); - y.observe(viewport, { - attributes: true - }); - y.observe(root, { - attributes: true - }); - var x = new MutationObserver(function(mutations) { - var menu = document.querySelector('.mSideMenu'); - if (menu !== null) { - x.disconnect(); - console.log('Found side menu'); - while (root.firstChild) - root.removeChild(root.firstChild); - while (menu.childNodes.length) - root.appendChild(menu.childNodes[0]); - Frost.emit(0); - setTimeout(function() { - y.disconnect(); - console.log('Unhook styler'); - Frost.handleHtml(document.documentElement.outerHTML); - }, 500); - } - }); - x.observe(document.querySelector('#mJewelNav'), { - childList: true, - subtree: true - }); - document.querySelector('#bookmarks_jewel').querySelector('a').click(); -} -//otherwise we've already found the side nav and this is unnecessary +//click menu and move contents to main view +console.log('Fetching menu'); +var viewport = document.querySelector('#viewport'); +var root = document.querySelector('#root'); +var y = new MutationObserver(function(mutations) { + viewport.removeAttribute('style'); + root.removeAttribute('style'); +}); +y.observe(viewport, { + attributes: true +}); +y.observe(root, { + attributes: true +}); +var x = new MutationObserver(function(mutations) { + var menu = document.querySelector('.mSideMenu'); + if (menu !== null) { + x.disconnect(); + console.log('Found side menu'); + while (root.firstChild) + root.removeChild(root.firstChild); + while (menu.childNodes.length) + root.appendChild(menu.childNodes[0]); + Frost.emit(0); + setTimeout(function() { + y.disconnect(); + console.log('Unhook styler'); + Frost.handleHtml(document.documentElement.outerHTML); + }, 500); + } +}); +x.observe(document.querySelector('#mJewelNav'), { + childList: true, + subtree: true +}); +document.querySelector('#bookmarks_jewel').querySelector('a').click(); |