"use strict";
var main = (function() {
  var transitionend = utilities.whichTransitionEvent(),
      animationend  = utilities.whichAnimationEvent(),
      main          = document.querySelector("main"),
      body          = document.querySelector("body"),
      nav           = document.querySelector("[role=navigation]");

  function init() {
    bindings();
  }

  function loaded() {
    body.setAttribute("aria-busy", "false");
  }

  function closeMenu(transitions_off) {
    if (typeof transitions_off !== "undefined") {
      body.classList.add("transitions-off");
    }

    body.classList.remove("menu-open");
    nav.setAttribute("aria-hidden", "true");
    setTimeout(function() {
      body.classList.remove("transitions-off");
    });

  }

  function toggleMenu(fast_close) {
    if (body.classList.contains("menu-open")) {
      body.classList.remove("menu-open");
      nav.setAttribute("aria-hidden", "true");
    } else {
      body.classList.add("menu-open");
      nav.setAttribute("aria-hidden", "false");

      setTimeout(function() {
        nav.focus();
      }, 300);
    }
  }

  function bindings() {
    var toggle_menu    = document.querySelector("#toggle-menu"),
        content_pusher = document.querySelector(".content-pusher"),
        nav_links      = document.querySelectorAll(".nav-link"),
        ESC            = 27;

    [].forEach.call(nav_links, function(el) {
      el.addEventListener("click", function(e) {
        closeMenu(true);
      });
    });

    window.addEventListener("load", loaded);
    toggle_menu.addEventListener("click", toggleMenu);
    toggle_menu.addEventListener("touchstart", toggleMenu);

    document.onkeydown = function(e) {
      if (e.keyCode === ESC) {
        closeMenu();
      }
    }

    document.addEventListener("touchstart", function(){}, true);
  }

  function chain(obj) {
    var waiting_for = document.querySelector(obj.waiting_for),
        next_up     = document.querySelector(obj.next_up),
        apply       = obj.apply;

    transitionend && waiting_for.addEventListener(transitionend, function() {
      next_up.classList.add(apply);
    });
  }

  function loadTemplate(template, destination) {
    var t           = document.querySelector(template),
        clone       = document.importNode(t.content, true),
        destination = document.querySelector(destination);

    destination.setAttribute("aria-busy", "true");
    destination.appendChild(clone);
    destination.setAttribute("aria-busy", "false");
  }

  return {
    init: init,
    chain: chain,
    loadTemplate: loadTemplate
  };

})();

@@ -52,16 +52,17 @@
 tionend 
+ 
 = utilit
@@ -101,32 +101,33 @@
   animationend  
+ 
 = utilities.whic
@@ -157,32 +157,33 @@
   main          
+ 
 = document.query
@@ -212,32 +212,33 @@
   body          
+ 
 = document.query
@@ -267,32 +267,33 @@
   nav           
+ 
 = document.query
@@ -321,16 +321,81 @@
 ation%5D%22)
+,%0A      content_pusher =document.querySelector(%22.content-pusher%22)
 ;%0A%0A  fun
@@ -813,16 +813,414 @@
     %7D);%0A
+  %7D%0A%0A  function disableMobileScrolling() %7B%0A    content_pusher.addEventListener(%22touchstart%22, function(e) %7B e.preventDefault(); %7D);%0A    content_pusher.addEventListener(%22touchmove%22, function(e) %7B e.preventDefault(); %7D);%0A  %7D%0A%0A  function enableMobileScrolling() %7B%0A    content_pusher.removeEventListener(%22touchstart%22, function(e) %7B%7D);%0A    content_pusher.removeEventListener(%22touchmove%22, function(e) %7B%7D);
 %0A  %7D%0A%0A  
@@ -1243,18 +1243,8 @@
 enu(
-fast_close
 ) %7B%0A
@@ -1376,24 +1376,56 @@
 %22, %22true%22);%0A
+      disableMobileScrolling();%0A
     %7D else %7B
@@ -1511,16 +1511,47 @@
 false%22);
+%0A      enableMobileScrolling();
 %0A%0A      
@@ -1714,76 +1714,8 @@
 %22),%0A
-        content_pusher = document.querySelector(%22.content-pusher%22),%0A
     

disable vertical mobile scrolling during overlay