Skip to content

Commit

Permalink
Run grunt.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Aug 27, 2014
1 parent 6276e76 commit b227182
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 27 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module.exports = function(grunt) {
sass: {
options: {
banner: '<%= banner %>',
sourcemap: 'none',
style: 'expanded',
unixNewlines: true
},
Expand Down
1 change: 0 additions & 1 deletion dist/css/ratchet-theme-ios.css
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ textarea,
-webkit-box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
}

to {
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);
box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);
Expand Down
12 changes: 6 additions & 6 deletions dist/css/ratchet.css
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ p {
white-space: nowrap;
vertical-align: top;
cursor: pointer;
background-color: white;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 3px;
}
Expand Down Expand Up @@ -492,7 +492,7 @@ input[type="button"] {
height: 44px;
padding-right: 10px;
padding-left: 10px;
background-color: white;
background-color: #fff;
border-bottom: 1px solid #ddd;

-webkit-backface-visibility: hidden;
Expand Down Expand Up @@ -694,7 +694,7 @@ input[type="button"] {
.card {
margin: 10px;
overflow: hidden;
background-color: white;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 6px;
}
Expand Down Expand Up @@ -926,7 +926,7 @@ select {
overflow: hidden;
font-size: 12px;
font-weight: 400;
background-color: white;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 3px;
}
Expand Down Expand Up @@ -1013,7 +1013,7 @@ select {
display: none;
width: 280px;
margin-left: -140px;
background-color: white;
background-color: #fff;
border-radius: 6px;
-webkit-box-shadow: 0 0 15px rgba(0, 0, 0, .1);
box-shadow: 0 0 15px rgba(0, 0, 0, .1);
Expand All @@ -1034,7 +1034,7 @@ select {
margin-left: -15px;
content: '';
border-right: 15px solid transparent;
border-bottom: 15px solid white;
border-bottom: 15px solid #fff;
border-left: 15px solid transparent;
}
.popover.visible {
Expand Down
27 changes: 23 additions & 4 deletions dist/js/ratchet.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@
}
cacheMapping[data.id] = JSON.stringify(data);
window.history.replaceState(data.id, data.title, data.url);
domCache[data.id] = document.body.cloneNode(true);
};

var cachePush = function () {
Expand All @@ -200,7 +199,7 @@
delete cacheMapping[cacheBackStack.shift()];
}

window.history.pushState(null, '', cacheMapping[PUSH.id].url);
window.history.pushState(null, '', getCached(PUSH.id).url);

cacheMapping.cacheForwardStack = JSON.stringify(cacheForwardStack);
cacheMapping.cacheBackStack = JSON.stringify(cacheBackStack);
Expand Down Expand Up @@ -331,7 +330,9 @@
swapContent(
(activeObj.contents || activeDom).cloneNode(true),
document.querySelector('.content'),
transition
transition, function() {
triggerStateChange();
}
);

PUSH.id = id;
Expand Down Expand Up @@ -383,6 +384,8 @@
});
}

cacheCurrentContent();

if (options.timeout) {
options._timeout = setTimeout(function () { xhr.abort('timeout'); }, options.timeout);
}
Expand All @@ -394,6 +397,10 @@
}
};

function cacheCurrentContent() {
domCache[PUSH.id] = document.body.cloneNode(true);
}


// Main XHR handlers
// =================
Expand Down Expand Up @@ -713,6 +720,7 @@
var slideNumber;
var isScrolling;
var scrollableArea;
var startedMoving;

var getSlider = function (target) {
var i;
Expand Down Expand Up @@ -773,12 +781,17 @@
return; // Exit if a pinch || no slider
}

// adjust the starting position if we just started to avoid jumpage
if (!startedMoving) {
pageX += (e.touches[0].pageX - pageX) - 1;
}

deltaX = e.touches[0].pageX - pageX;
deltaY = e.touches[0].pageY - pageY;
pageX = e.touches[0].pageX;
pageY = e.touches[0].pageY;

if (typeof isScrolling === 'undefined') {
if (typeof isScrolling === 'undefined' && startedMoving) {
isScrolling = Math.abs(deltaY) > Math.abs(deltaX);
}

Expand All @@ -794,13 +807,19 @@
slideNumber === lastSlide && deltaX < 0 ? (Math.abs(pageX) / sliderWidth) + 1.25 : 1;

slider.style.webkitTransform = 'translate3d(' + offsetX + 'px,0,0)';

// started moving
startedMoving = true;
};

var onTouchEnd = function (e) {
if (!slider || isScrolling) {
return;
}

// we're done moving
startedMoving = false;

setSlideNumber(
(+new Date()) - startTime < 1000 && Math.abs(deltaX) > 15 ? (deltaX < 0 ? -1 : 1) : 0
);
Expand Down
2 changes: 1 addition & 1 deletion dist/js/ratchet.min.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions docs/assets/css/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ body {
background-image: -ms-linear-gradient(45deg, #0a1855 0%, #da0024 100%);
background-image: -o-linear-gradient(45deg, #0a1855 0%, #da0024 100%);
background-image: linear-gradient(45deg, #0a1855 0%, #da0024 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0a1855', endColorstr='#da0024', GradientType=1 );
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0a1855', endColorstr='#da0024', GradientType=1 );
}

.docs-header {
Expand Down Expand Up @@ -1386,7 +1386,6 @@ hr {
-webkit-box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
}

to {
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);
box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);
Expand Down Expand Up @@ -1977,7 +1976,6 @@ hr {
0% {
opacity: 0;
}

100% {
opacity: 1;
}
Expand Down
1 change: 0 additions & 1 deletion docs/dist/css/ratchet-theme-ios.css
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ textarea,
-webkit-box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
}

to {
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);
box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);
Expand Down
12 changes: 6 additions & 6 deletions docs/dist/css/ratchet.css
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ p {
white-space: nowrap;
vertical-align: top;
cursor: pointer;
background-color: white;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 3px;
}
Expand Down Expand Up @@ -492,7 +492,7 @@ input[type="button"] {
height: 44px;
padding-right: 10px;
padding-left: 10px;
background-color: white;
background-color: #fff;
border-bottom: 1px solid #ddd;

-webkit-backface-visibility: hidden;
Expand Down Expand Up @@ -694,7 +694,7 @@ input[type="button"] {
.card {
margin: 10px;
overflow: hidden;
background-color: white;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 6px;
}
Expand Down Expand Up @@ -926,7 +926,7 @@ select {
overflow: hidden;
font-size: 12px;
font-weight: 400;
background-color: white;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 3px;
}
Expand Down Expand Up @@ -1013,7 +1013,7 @@ select {
display: none;
width: 280px;
margin-left: -140px;
background-color: white;
background-color: #fff;
border-radius: 6px;
-webkit-box-shadow: 0 0 15px rgba(0, 0, 0, .1);
box-shadow: 0 0 15px rgba(0, 0, 0, .1);
Expand All @@ -1034,7 +1034,7 @@ select {
margin-left: -15px;
content: '';
border-right: 15px solid transparent;
border-bottom: 15px solid white;
border-bottom: 15px solid #fff;
border-left: 15px solid transparent;
}
.popover.visible {
Expand Down
27 changes: 23 additions & 4 deletions docs/dist/js/ratchet.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@
}
cacheMapping[data.id] = JSON.stringify(data);
window.history.replaceState(data.id, data.title, data.url);
domCache[data.id] = document.body.cloneNode(true);
};

var cachePush = function () {
Expand All @@ -200,7 +199,7 @@
delete cacheMapping[cacheBackStack.shift()];
}

window.history.pushState(null, '', cacheMapping[PUSH.id].url);
window.history.pushState(null, '', getCached(PUSH.id).url);

cacheMapping.cacheForwardStack = JSON.stringify(cacheForwardStack);
cacheMapping.cacheBackStack = JSON.stringify(cacheBackStack);
Expand Down Expand Up @@ -331,7 +330,9 @@
swapContent(
(activeObj.contents || activeDom).cloneNode(true),
document.querySelector('.content'),
transition
transition, function() {
triggerStateChange();
}
);

PUSH.id = id;
Expand Down Expand Up @@ -383,6 +384,8 @@
});
}

cacheCurrentContent();

if (options.timeout) {
options._timeout = setTimeout(function () { xhr.abort('timeout'); }, options.timeout);
}
Expand All @@ -394,6 +397,10 @@
}
};

function cacheCurrentContent() {
domCache[PUSH.id] = document.body.cloneNode(true);
}


// Main XHR handlers
// =================
Expand Down Expand Up @@ -713,6 +720,7 @@
var slideNumber;
var isScrolling;
var scrollableArea;
var startedMoving;

var getSlider = function (target) {
var i;
Expand Down Expand Up @@ -773,12 +781,17 @@
return; // Exit if a pinch || no slider
}

// adjust the starting position if we just started to avoid jumpage
if (!startedMoving) {
pageX += (e.touches[0].pageX - pageX) - 1;
}

deltaX = e.touches[0].pageX - pageX;
deltaY = e.touches[0].pageY - pageY;
pageX = e.touches[0].pageX;
pageY = e.touches[0].pageY;

if (typeof isScrolling === 'undefined') {
if (typeof isScrolling === 'undefined' && startedMoving) {
isScrolling = Math.abs(deltaY) > Math.abs(deltaX);
}

Expand All @@ -794,13 +807,19 @@
slideNumber === lastSlide && deltaX < 0 ? (Math.abs(pageX) / sliderWidth) + 1.25 : 1;

slider.style.webkitTransform = 'translate3d(' + offsetX + 'px,0,0)';

// started moving
startedMoving = true;
};

var onTouchEnd = function (e) {
if (!slider || isScrolling) {
return;
}

// we're done moving
startedMoving = false;

setSlideNumber(
(+new Date()) - startTime < 1000 && Math.abs(deltaX) > 15 ? (deltaX < 0 ? -1 : 1) : 0
);
Expand Down
2 changes: 1 addition & 1 deletion docs/dist/js/ratchet.min.js

Large diffs are not rendered by default.

0 comments on commit b227182

Please sign in to comment.