fmartingr.com-legacy/fmartingrcom/themes/v1/templates/static/js/mobile.js

28 lines
808 B
JavaScript

// Generated by CoffeeScript 1.6.2
(function() {
var toggleMenu,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
toggleMenu = function() {
var button, sidebar;
sidebar = document.querySelector('.sidebar');
button = document.querySelector('button.menu');
if (__indexOf.call(button.classList, 'menu-shown') >= 0) {
sidebar.classList.remove('shown');
return button.classList.remove('menu-shown');
} else {
sidebar.classList.add('shown');
return button.classList.add('menu-shown');
}
};
window.onload = function() {
var button;
button = document.querySelector('button.menu');
return button.onclick = toggleMenu;
};
}).call(this);