Skip to content

Instantly share code, notes, and snippets.

@aderowbotham
Created November 6, 2014 11:33
Show Gist options
  • Save aderowbotham/5eb05da7cf3db2ad1795 to your computer and use it in GitHub Desktop.
Save aderowbotham/5eb05da7cf3db2ad1795 to your computer and use it in GitHub Desktop.
Hide items from the admin menu in Pancake (http://pancakeapp.com/)
// this works as of 6 Nov 2014, Pancake 4.6.10
// set the names of menu items you want to hide here (either the href or text content of each top-level link)
var itemsToHide = ["#proposals", "credit notes"];
$( document ).ready(function(){
hideMenuItems();
// run again after Pancake's JS has run
setTimeout(hideMenuItems, 50);
function hideMenuItems(){
$(".top-bar ul.left .js-not-more-li").each(function(){
var aTag = $(this).find('a');
var href= aTag.attr('href');
var text = aTag.text().toLowerCase();
if(itemsToHide.indexOf(href) != -1 || itemsToHide.indexOf(text) != -1){
$(this).hide();
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment