Donmclean
1/12/2016 - 8:24 PM

Infamous Javascript Breaker Logic

Infamous Javascript Breaker Logic


// handles break logic
var isActive = function (clicked) {
    if(clicked) {
      if (window.sessionStorage.getItem('IsActive') !== 'true') {
        window.sessionStorage.setItem('IsActive', 'true');
        return true;
      }
    }
    if(!clicked) { 
      if (window.sessionStorage.getItem('IsActive') === 'true') {
        window.sessionStorage.setItem('IsActive', 'false');
        return false;
      }
    }
  };