X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=dist%2Fratchet.js;fp=dist%2Fratchet.js;h=d19d1ea8ab8d1892cc955932dac25c0cbfb39e97;hb=c0813f157a8e2c378f7b65d672fab1438f115068;hp=244354230c9064b33372352f5da9b0bd0aa74b5a;hpb=0428e45b9ad1629a4c0a8f37a2fc73ad57da5b76;p=ratchet diff --git a/dist/ratchet.js b/dist/ratchet.js index 2443542..d19d1ea 100644 --- a/dist/ratchet.js +++ b/dist/ratchet.js @@ -13,38 +13,30 @@ * ---------------------------------- */ !function () { - findModals = function ( target ) { - var i, - modals = document.querySelectorAll( 'a' ); + var findModals = function (target) { + var i; + var modals = document.querySelectorAll('a'); - for ( ; target && target !== document; target = target.parentNode ) { - for ( i = modals.length; i--; ) { if ( modals[i] === target ) return target; } + for (; target && target !== document; target = target.parentNode) { + for (i = modals.length; i--;) { if (modals[i] === target) return target; } } }; - getModal = function ( event ) { - var modal, - modalToggle = findModals( event.target ); - - if ( !modalToggle || !modalToggle.hash ) return; - - modal = document.querySelector( modalToggle.hash ) + var getModal = function (event) { + var modalToggle = findModals(event.target); + if (!modalToggle || !modalToggle.hash) return; - if ( !modal ) return; - return modal; + return document.querySelector(modalToggle.hash); }; - window.addEventListener( 'touchend', function ( event ) { - var modal = getModal( event ); - - if ( !modal ) return; - - modal.classList.toggle( 'active' ); - } ); + window.addEventListener('touchend', function (event) { + var modal = getModal(event); + if (modal) modal.classList.toggle('active'); + }); - window.addEventListener( 'click', function ( event ) { - if ( getModal( event ) ) event.preventDefault(); - } ); + window.addEventListener('click', function (event) { + if (getModal(event)) event.preventDefault(); + }); }();/* ---------------------------------- * POPOVER v1.0.0 * Licensed under The MIT License