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

40
dist/ratchet.js vendored

@ -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

Loading…
Cancel
Save