Browse Source

Rebuild ratchet

pull/135/head
Ben Schwarz 12 years ago
parent
commit
c0813f157a
  1. 14
      dist/ratchet.css
  2. 40
      dist/ratchet.js

14
dist/ratchet.css vendored

@ -1131,23 +1131,21 @@ select {
}/* Modals }/* Modals
-------------------------------------------------- */ -------------------------------------------------- */
.modal { .modal {
position: fixed; top: 0; position: fixed;
top: 0;
background-color: #fff; background-color: #fff;
width: 100%; width: 100%;
-webkit-transform: translateY(100%); -webkit-transform: translateY(100%);
transform: translateY(100%); transform: translateY(100%);
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
-webkit-transition: -webkit-transform .25s ease-in-out, opacity 1ms .25s; -webkit-transition: -webkit-transform .25s ease-in-out, opacity 1ms .25s;
transition: transform .25s ease-in-out, opacity 1ms .25s; transition: transform .25s ease-in-out, opacity 1ms .25s;
opacity: 0; opacity: 0;
overflow: hidden; overflow: hidden;
/*
Normally, we'd use '1', … ratchet uses '10'
for the title bar, so deal with that.
*/
z-index: 11; z-index: 11;
min-height: 100%; min-height: 100%;
@ -1157,10 +1155,12 @@ select {
-------------------------------------------------- */ -------------------------------------------------- */
.modal.active { .modal.active {
-webkit-transition: -webkit-transform .25s ease-in-out; -webkit-transition: -webkit-transform .25s ease-in-out;
transition: transform: .25 ease-in-out; transition: transform: .25 ease-in-out;
-webkit-transform: translateY(0); -webkit-transform: translateY(0);
transform: translateY(0); transform: translateY(0);
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
opacity: 1; opacity: 1;
height: 100%; height: 100%;

40
dist/ratchet.js vendored

@ -13,38 +13,30 @@
* ---------------------------------- */ * ---------------------------------- */
!function () { !function () {
findModals = function ( target ) { var findModals = function (target) {
var i, var i;
modals = document.querySelectorAll( 'a' ); var modals = document.querySelectorAll('a');
for ( ; target && target !== document; target = target.parentNode ) { for (; target && target !== document; target = target.parentNode) {
for ( i = modals.length; i--; ) { if ( modals[i] === target ) return target; } for (i = modals.length; i--;) { if (modals[i] === target) return target; }
} }
}; };
getModal = function ( event ) { var getModal = function (event) {
var modal, var modalToggle = findModals(event.target);
modalToggle = findModals( event.target ); if (!modalToggle || !modalToggle.hash) return;
if ( !modalToggle || !modalToggle.hash ) return;
modal = document.querySelector( modalToggle.hash )
if ( !modal ) return; return document.querySelector(modalToggle.hash);
return modal;
}; };
window.addEventListener( 'touchend', function ( event ) { window.addEventListener('touchend', function (event) {
var modal = getModal( event ); var modal = getModal(event);
if (modal) modal.classList.toggle('active');
if ( !modal ) return; });
modal.classList.toggle( 'active' );
} );
window.addEventListener( 'click', function ( event ) { window.addEventListener('click', function (event) {
if ( getModal( event ) ) event.preventDefault(); if (getModal(event)) event.preventDefault();
} ); });
}();/* ---------------------------------- }();/* ----------------------------------
* POPOVER v1.0.0 * POPOVER v1.0.0
* Licensed under The MIT License * Licensed under The MIT License

Loading…
Cancel
Save