Skip to content

Commit b227182

Browse files
committed
Run grunt.
1 parent 6276e76 commit b227182

File tree

10 files changed

+62
-27
lines changed

10 files changed

+62
-27
lines changed

Gruntfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ module.exports = function(grunt) {
6464
sass: {
6565
options: {
6666
banner: '<%= banner %>',
67+
sourcemap: 'none',
6768
style: 'expanded',
6869
unixNewlines: true
6970
},

dist/css/ratchet-theme-ios.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ textarea,
463463
-webkit-box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
464464
box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
465465
}
466-
467466
to {
468467
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);
469468
box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);

dist/css/ratchet.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ p {
370370
white-space: nowrap;
371371
vertical-align: top;
372372
cursor: pointer;
373-
background-color: white;
373+
background-color: #fff;
374374
border: 1px solid #ccc;
375375
border-radius: 3px;
376376
}
@@ -492,7 +492,7 @@ input[type="button"] {
492492
height: 44px;
493493
padding-right: 10px;
494494
padding-left: 10px;
495-
background-color: white;
495+
background-color: #fff;
496496
border-bottom: 1px solid #ddd;
497497

498498
-webkit-backface-visibility: hidden;
@@ -694,7 +694,7 @@ input[type="button"] {
694694
.card {
695695
margin: 10px;
696696
overflow: hidden;
697-
background-color: white;
697+
background-color: #fff;
698698
border: 1px solid #ddd;
699699
border-radius: 6px;
700700
}
@@ -926,7 +926,7 @@ select {
926926
overflow: hidden;
927927
font-size: 12px;
928928
font-weight: 400;
929-
background-color: white;
929+
background-color: #fff;
930930
border: 1px solid #ccc;
931931
border-radius: 3px;
932932
}
@@ -1013,7 +1013,7 @@ select {
10131013
display: none;
10141014
width: 280px;
10151015
margin-left: -140px;
1016-
background-color: white;
1016+
background-color: #fff;
10171017
border-radius: 6px;
10181018
-webkit-box-shadow: 0 0 15px rgba(0, 0, 0, .1);
10191019
box-shadow: 0 0 15px rgba(0, 0, 0, .1);
@@ -1034,7 +1034,7 @@ select {
10341034
margin-left: -15px;
10351035
content: '';
10361036
border-right: 15px solid transparent;
1037-
border-bottom: 15px solid white;
1037+
border-bottom: 15px solid #fff;
10381038
border-left: 15px solid transparent;
10391039
}
10401040
.popover.visible {

dist/js/ratchet.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@
182182
}
183183
cacheMapping[data.id] = JSON.stringify(data);
184184
window.history.replaceState(data.id, data.title, data.url);
185-
domCache[data.id] = document.body.cloneNode(true);
186185
};
187186

188187
var cachePush = function () {
@@ -200,7 +199,7 @@
200199
delete cacheMapping[cacheBackStack.shift()];
201200
}
202201

203-
window.history.pushState(null, '', cacheMapping[PUSH.id].url);
202+
window.history.pushState(null, '', getCached(PUSH.id).url);
204203

205204
cacheMapping.cacheForwardStack = JSON.stringify(cacheForwardStack);
206205
cacheMapping.cacheBackStack = JSON.stringify(cacheBackStack);
@@ -331,7 +330,9 @@
331330
swapContent(
332331
(activeObj.contents || activeDom).cloneNode(true),
333332
document.querySelector('.content'),
334-
transition
333+
transition, function() {
334+
triggerStateChange();
335+
}
335336
);
336337

337338
PUSH.id = id;
@@ -383,6 +384,8 @@
383384
});
384385
}
385386

387+
cacheCurrentContent();
388+
386389
if (options.timeout) {
387390
options._timeout = setTimeout(function () { xhr.abort('timeout'); }, options.timeout);
388391
}
@@ -394,6 +397,10 @@
394397
}
395398
};
396399

400+
function cacheCurrentContent() {
401+
domCache[PUSH.id] = document.body.cloneNode(true);
402+
}
403+
397404

398405
// Main XHR handlers
399406
// =================
@@ -713,6 +720,7 @@
713720
var slideNumber;
714721
var isScrolling;
715722
var scrollableArea;
723+
var startedMoving;
716724

717725
var getSlider = function (target) {
718726
var i;
@@ -773,12 +781,17 @@
773781
return; // Exit if a pinch || no slider
774782
}
775783

784+
// adjust the starting position if we just started to avoid jumpage
785+
if (!startedMoving) {
786+
pageX += (e.touches[0].pageX - pageX) - 1;
787+
}
788+
776789
deltaX = e.touches[0].pageX - pageX;
777790
deltaY = e.touches[0].pageY - pageY;
778791
pageX = e.touches[0].pageX;
779792
pageY = e.touches[0].pageY;
780793

781-
if (typeof isScrolling === 'undefined') {
794+
if (typeof isScrolling === 'undefined' && startedMoving) {
782795
isScrolling = Math.abs(deltaY) > Math.abs(deltaX);
783796
}
784797

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

796809
slider.style.webkitTransform = 'translate3d(' + offsetX + 'px,0,0)';
810+
811+
// started moving
812+
startedMoving = true;
797813
};
798814

799815
var onTouchEnd = function (e) {
800816
if (!slider || isScrolling) {
801817
return;
802818
}
803819

820+
// we're done moving
821+
startedMoving = false;
822+
804823
setSlideNumber(
805824
(+new Date()) - startTime < 1000 && Math.abs(deltaX) > 15 ? (deltaX < 0 ? -1 : 1) : 0
806825
);

dist/js/ratchet.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/css/docs.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ body {
6464
background-image: -ms-linear-gradient(45deg, #0a1855 0%, #da0024 100%);
6565
background-image: -o-linear-gradient(45deg, #0a1855 0%, #da0024 100%);
6666
background-image: linear-gradient(45deg, #0a1855 0%, #da0024 100%);
67-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0a1855', endColorstr='#da0024', GradientType=1 );
67+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0a1855', endColorstr='#da0024', GradientType=1 );
6868
}
6969

7070
.docs-header {
@@ -1386,7 +1386,6 @@ hr {
13861386
-webkit-box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
13871387
box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
13881388
}
1389-
13901389
to {
13911390
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);
13921391
box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);
@@ -1977,7 +1976,6 @@ hr {
19771976
0% {
19781977
opacity: 0;
19791978
}
1980-
19811979
100% {
19821980
opacity: 1;
19831981
}

docs/dist/css/ratchet-theme-ios.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ textarea,
463463
-webkit-box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
464464
box-shadow: 0 0 10px transparent, -320px 0 0 transparent;
465465
}
466-
467466
to {
468467
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);
469468
box-shadow: 0 0 10px rgba(0, 0, 0, .3), -320px 0 0 rgba(0, 0, 0, .1);

docs/dist/css/ratchet.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ p {
370370
white-space: nowrap;
371371
vertical-align: top;
372372
cursor: pointer;
373-
background-color: white;
373+
background-color: #fff;
374374
border: 1px solid #ccc;
375375
border-radius: 3px;
376376
}
@@ -492,7 +492,7 @@ input[type="button"] {
492492
height: 44px;
493493
padding-right: 10px;
494494
padding-left: 10px;
495-
background-color: white;
495+
background-color: #fff;
496496
border-bottom: 1px solid #ddd;
497497

498498
-webkit-backface-visibility: hidden;
@@ -694,7 +694,7 @@ input[type="button"] {
694694
.card {
695695
margin: 10px;
696696
overflow: hidden;
697-
background-color: white;
697+
background-color: #fff;
698698
border: 1px solid #ddd;
699699
border-radius: 6px;
700700
}
@@ -926,7 +926,7 @@ select {
926926
overflow: hidden;
927927
font-size: 12px;
928928
font-weight: 400;
929-
background-color: white;
929+
background-color: #fff;
930930
border: 1px solid #ccc;
931931
border-radius: 3px;
932932
}
@@ -1013,7 +1013,7 @@ select {
10131013
display: none;
10141014
width: 280px;
10151015
margin-left: -140px;
1016-
background-color: white;
1016+
background-color: #fff;
10171017
border-radius: 6px;
10181018
-webkit-box-shadow: 0 0 15px rgba(0, 0, 0, .1);
10191019
box-shadow: 0 0 15px rgba(0, 0, 0, .1);
@@ -1034,7 +1034,7 @@ select {
10341034
margin-left: -15px;
10351035
content: '';
10361036
border-right: 15px solid transparent;
1037-
border-bottom: 15px solid white;
1037+
border-bottom: 15px solid #fff;
10381038
border-left: 15px solid transparent;
10391039
}
10401040
.popover.visible {

docs/dist/js/ratchet.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@
182182
}
183183
cacheMapping[data.id] = JSON.stringify(data);
184184
window.history.replaceState(data.id, data.title, data.url);
185-
domCache[data.id] = document.body.cloneNode(true);
186185
};
187186

188187
var cachePush = function () {
@@ -200,7 +199,7 @@
200199
delete cacheMapping[cacheBackStack.shift()];
201200
}
202201

203-
window.history.pushState(null, '', cacheMapping[PUSH.id].url);
202+
window.history.pushState(null, '', getCached(PUSH.id).url);
204203

205204
cacheMapping.cacheForwardStack = JSON.stringify(cacheForwardStack);
206205
cacheMapping.cacheBackStack = JSON.stringify(cacheBackStack);
@@ -331,7 +330,9 @@
331330
swapContent(
332331
(activeObj.contents || activeDom).cloneNode(true),
333332
document.querySelector('.content'),
334-
transition
333+
transition, function() {
334+
triggerStateChange();
335+
}
335336
);
336337

337338
PUSH.id = id;
@@ -383,6 +384,8 @@
383384
});
384385
}
385386

387+
cacheCurrentContent();
388+
386389
if (options.timeout) {
387390
options._timeout = setTimeout(function () { xhr.abort('timeout'); }, options.timeout);
388391
}
@@ -394,6 +397,10 @@
394397
}
395398
};
396399

400+
function cacheCurrentContent() {
401+
domCache[PUSH.id] = document.body.cloneNode(true);
402+
}
403+
397404

398405
// Main XHR handlers
399406
// =================
@@ -713,6 +720,7 @@
713720
var slideNumber;
714721
var isScrolling;
715722
var scrollableArea;
723+
var startedMoving;
716724

717725
var getSlider = function (target) {
718726
var i;
@@ -773,12 +781,17 @@
773781
return; // Exit if a pinch || no slider
774782
}
775783

784+
// adjust the starting position if we just started to avoid jumpage
785+
if (!startedMoving) {
786+
pageX += (e.touches[0].pageX - pageX) - 1;
787+
}
788+
776789
deltaX = e.touches[0].pageX - pageX;
777790
deltaY = e.touches[0].pageY - pageY;
778791
pageX = e.touches[0].pageX;
779792
pageY = e.touches[0].pageY;
780793

781-
if (typeof isScrolling === 'undefined') {
794+
if (typeof isScrolling === 'undefined' && startedMoving) {
782795
isScrolling = Math.abs(deltaY) > Math.abs(deltaX);
783796
}
784797

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

796809
slider.style.webkitTransform = 'translate3d(' + offsetX + 'px,0,0)';
810+
811+
// started moving
812+
startedMoving = true;
797813
};
798814

799815
var onTouchEnd = function (e) {
800816
if (!slider || isScrolling) {
801817
return;
802818
}
803819

820+
// we're done moving
821+
startedMoving = false;
822+
804823
setSlideNumber(
805824
(+new Date()) - startTime < 1000 && Math.abs(deltaX) > 15 ? (deltaX < 0 ? -1 : 1) : 0
806825
);

docs/dist/js/ratchet.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)