Sha256: 9fcaf03f3e46203b1f3d684c5925a6e56b07a762b666eacf917f9cca4a533539
Contents?: true
Size: 1.02 KB
Versions: 34
Compression:
Stored size: 1.02 KB
Contents
(function (window, document) { var menu = document.getElementById('rm-nav'), WINDOW_CHANGE_EVENT = ('onorientationchange' in window) ? 'orientationchange':'resize'; function toggleHorizontal() { [].forEach.call( document.getElementById('rm-nav').querySelectorAll('.rm-can-transform'), function(el){ el.classList.toggle('pure-menu-horizontal'); } ); }; function toggleMenu() { // set timeout so that the panel has a chance to roll up // before the menu switches states if (menu.classList.contains('open')) { setTimeout(toggleHorizontal, 500); } else { toggleHorizontal(); } menu.classList.toggle('open'); document.getElementById('rm-toggle').classList.toggle('x'); }; function closeMenu() { if (menu.classList.contains('open')) { toggleMenu(); } } document.getElementById('rm-toggle').addEventListener('click', function (e) { toggleMenu(); }); window.addEventListener(WINDOW_CHANGE_EVENT, closeMenu); })(this, this.document);
Version data entries
34 entries across 34 versions & 1 rubygems