in another question on SO, I was determining how to toggle off a function, and the working solution is this:
I place var disabledFlag = true; in the head section of my page and before calling shell.js, then in shell.js I have:
/*******************************/
/*  TOGGLE BUTTON
/*******************************/
var toggleBlock = function() {
    console.log(disabledFlag);
    if(!disabledFlag){
      var windowsize = $(window).width(),
      isDesktop = windowsize > 765;
      $("#quicksearch").toggleClass("collapse in", isDesktop);
      $("#quicksearch").toggleClass("collapse out", !isDesktop);
      $("#sidebar").toggleClass("collapse in", isDesktop);
      $("#sidebar").toggleClass("collapse out", !isDesktop);
    }
    else {
      $("#quicksearch").addClass("collapse out");
      $("#sidebar").addClass("collapse out");  
    }
}
$(document).ready(toggleBlock);
$(window).on("resize.showContent", toggleBlock);
toggleBlock();
shell.js is an common file that is shared with other sites and may not have the variable defined. how do I check if the variable is defined, and if not assign it to false and then execute the code above?
 
     
     
     
     
     
    