var subMenuItem = document.querySelectorAll('.sub-menu .menu-item'),
    subMenu     = document.querySelectorAll('.sub-menu');

document.addEventListener('focus', focusToggle, true);

function focusToggle( e ) {
  if ( e.target.classList.contains('is-sub-menu-item' ) || e.target.classList.contains('menu-level-') ) {
    subMenu[0].classList.add('hover');
  } else {
    subMenu[0].classList.remove('hover');
  }
}

function offCanvas( toggler, primary, wrap, direction ) {
  var body       = document.body,
      menuToggle = document.querySelector( toggler ),
      menu       = document.querySelector( primary ),
      wrap       = document.querySelector( wrap ),
      dir        = direction;

  menuToggle.onclick = function() {
    menu.classList.toggle('is-active');
    body.classList.toggle('is-active-off-canvas');
    if( body.classList.contains( 'is-active-off-canvas' ) ) {
      var menuWidth = menu.offsetWidth,
          bodyDir   = dir,
          wrapDir   = dir,
          bodyDir   = (bodyDir === 'left') ? body.style.left = menuWidth + 'px' : body.style.right = menuWidth + 'px',
          wrapDir   = (wrapDir === 'left') ? wrap.style.left = -menuWidth + 'px' : wrap.style.right = -menuWidth + 'px';
      
      wrap.classList.add( dir );
    } else {
      var bodyDir   = dir,
          wrapDir   = dir,
          bodyDir = (bodyDir === 'left') ? body.style.left = '0' : body.style.right = '0',
          wrapDir = (wrapDir === 'left') ? wrap.style.left = '0' : wrap.style.right = '0';
      wrap.classList.remove( dir );
    }
  }
}

offCanvas( '.site-menu-toggle', '.primary-menu', '.site-header', 'left' );
@@ -410,16 +410,495 @@
 %0A  %7D%0A%7D%0A%0A
+/**%0A * Adds helper function for devs to plug in basic values to assist in off canvas functionality.%0A * @param %7BElement%7D toggler         //The class name of the element that toggles the off canvas menu.%0A * @param %7BElement%7D primaryMenu     //The class name of the element that is the primary menu.%0A * @param %7BElement%7D primaryMenuWrap //The wrapper that contains the primary menu.%0A * @param %7BString%7D direction        //The direction that the off canvas menu should fly in from.%0A */%0A
 function
@@ -929,11 +929,26 @@
 mary
-, w
+Menu, primaryMenuW
 rap,
@@ -1100,16 +1100,20 @@
  primary
+Menu
  ),%0A    
@@ -1151,17 +1151,28 @@
 lector( 
-w
+primaryMenuW
 rap ),%0A 
@@ -1324,24 +1324,25 @@
 f-canvas');%0A
+%0A
     if( body

Add function comments and documentation. Alter function parameter names.