|
|
|
@ -1,11 +1,12 @@
|
|
|
|
|
/** |
|
|
|
|
* ================================== |
|
|
|
|
* Ratchet v1.0.2 |
|
|
|
|
* Licensed under The MIT License |
|
|
|
|
* http://opensource.org/licenses/MIT
|
|
|
|
|
* ================================== |
|
|
|
|
/* |
|
|
|
|
* ===================================================== |
|
|
|
|
* Ratchet v2.0.0 |
|
|
|
|
* Copyright 2013 Connor Sears, Dave Gamache, and Jacob Thornton |
|
|
|
|
* Licensed under http://www.opensource.org/licenses/MIT
|
|
|
|
|
* |
|
|
|
|
* Designed and built by @connors, @dhg, and @fat. |
|
|
|
|
* ===================================================== |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
/* ---------------------------------- |
|
|
|
|
* MODAL v1.0.0 |
|
|
|
|
* Licensed under The MIT License |
|
|
|
@ -30,68 +31,6 @@
|
|
|
|
|
var modal = getModal(event); |
|
|
|
|
if (modal) modal.classList.toggle('active'); |
|
|
|
|
}); |
|
|
|
|
}();/* ---------------------------------- |
|
|
|
|
* POPOVER v1.0.0 |
|
|
|
|
* Licensed under The MIT License |
|
|
|
|
* http://opensource.org/licenses/MIT
|
|
|
|
|
* ---------------------------------- */ |
|
|
|
|
|
|
|
|
|
!function () { |
|
|
|
|
|
|
|
|
|
var popover; |
|
|
|
|
|
|
|
|
|
var findPopovers = function (target) { |
|
|
|
|
var i, popovers = document.querySelectorAll('a'); |
|
|
|
|
for (; target && target !== document; target = target.parentNode) { |
|
|
|
|
for (i = popovers.length; i--;) { if (popovers[i] === target) return target; } |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
var onPopoverHidden = function () { |
|
|
|
|
document.body.removeChild(backdrop); |
|
|
|
|
popover.style.display = 'none'; |
|
|
|
|
popover.removeEventListener('webkitTransitionEnd', onPopoverHidden); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var backdrop = function () { |
|
|
|
|
var element = document.createElement('div'); |
|
|
|
|
|
|
|
|
|
element.classList.add('backdrop'); |
|
|
|
|
|
|
|
|
|
element.addEventListener('touchend', function () { |
|
|
|
|
popover.addEventListener('webkitTransitionEnd', onPopoverHidden); |
|
|
|
|
popover.classList.remove('visible'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return element; |
|
|
|
|
}(); |
|
|
|
|
|
|
|
|
|
var getPopover = function (e) { |
|
|
|
|
var anchor = findPopovers(e.target); |
|
|
|
|
|
|
|
|
|
if (!anchor || !anchor.hash) return; |
|
|
|
|
|
|
|
|
|
popover = document.querySelector(anchor.hash); |
|
|
|
|
|
|
|
|
|
if (!popover || !popover.classList.contains('popover')) return; |
|
|
|
|
|
|
|
|
|
return popover; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
window.addEventListener('touchend', function (e) { |
|
|
|
|
var popover = getPopover(e); |
|
|
|
|
|
|
|
|
|
if (!popover) return; |
|
|
|
|
|
|
|
|
|
popover.style.display = 'block'; |
|
|
|
|
popover.offsetHeight; |
|
|
|
|
popover.classList.add('visible'); |
|
|
|
|
|
|
|
|
|
popover.parentNode.appendChild(backdrop); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
window.addEventListener('click', function (e) { if (getPopover(e)) e.preventDefault(); }); |
|
|
|
|
|
|
|
|
|
}(); |
|
|
|
|
/* ---------------------------------- |
|
|
|
|
* PUSH v1.0.0 |
|
|
|
@ -511,6 +450,7 @@
|
|
|
|
|
window.addEventListener('popstate', popstate); |
|
|
|
|
|
|
|
|
|
}(); |
|
|
|
|
|
|
|
|
|
/* ---------------------------------- |
|
|
|
|
* TABS v1.0.0 |
|
|
|
|
* Licensed under The MIT License |
|
|
|
@ -557,7 +497,8 @@
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
window.addEventListener('click', function (e) { if (getTarget(e.target)) e.preventDefault(); }); |
|
|
|
|
}();/* ---------------------------------- |
|
|
|
|
}(); |
|
|
|
|
/* ---------------------------------- |
|
|
|
|
* SLIDER v1.0.1 |
|
|
|
|
* Licensed under The MIT License |
|
|
|
|
* Adapted from Brad Birdsall's swipe |
|
|
|
@ -671,6 +612,7 @@
|
|
|
|
|
window.addEventListener('touchend', onTouchEnd); |
|
|
|
|
|
|
|
|
|
}(); |
|
|
|
|
|
|
|
|
|
/* ---------------------------------- |
|
|
|
|
* TOGGLE v1.0.0 |
|
|
|
|
* Licensed under The MIT License |
|
|
|
|