Skip to content

Instantly share code, notes, and snippets.

@Ollo
Created October 10, 2014 17:44
Show Gist options
  • Save Ollo/34e0400f561ee6a93f6e to your computer and use it in GitHub Desktop.
Save Ollo/34e0400f561ee6a93f6e to your computer and use it in GitHub Desktop.
push-nav
.provider("$egPushMenuPrimary", function(){
if(window.screen.availWidth <= 1024) {
this.$get = [function(){
var menu = {};
menu.show = function show(){
var menu = angular.element(document.querySelector('#sp-nav'));
console.log(menu);
menu.addClass('show');
};
menu.hide = function hide(){
var menu = angular.element(document.querySelector('#sp-nav'));
menu.removeClass('show');
};
menu.toggle = function toggle() {
angular.element('body').toggleClass('menu_open');
};
return menu;
}];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment