Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/ratchet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2014-03-24 10:31:38 +0400
committerXhmikosR <xhmikosr@gmail.com>2015-01-30 12:29:26 +0300
commit51b9b81509587a312ff36ddb94c5118ecf57aaf5 (patch)
treeb2ed8bac3a1951a990c516e61defd73ac3fe739f
parent5803b2920b3c55bc076a1e37bfdc143d882fcbf4 (diff)
Run `grunt`.
-rw-r--r--dist/js/ratchet.js46
-rw-r--r--docs/dist/js/ratchet.js46
2 files changed, 64 insertions, 28 deletions
diff --git a/dist/js/ratchet.js b/dist/js/ratchet.js
index 85e8cfd..d865c64 100644
--- a/dist/js/ratchet.js
+++ b/dist/js/ratchet.js
@@ -103,8 +103,7 @@
try {
popover = document.querySelector(anchor.hash);
- }
- catch (error) {
+ } catch (error) {
popover = null;
}
@@ -370,7 +369,11 @@
clearTimeout(options._timeout);
}
if (xhr.readyState === 4) {
- xhr.status === 200 ? success(xhr, options) : failure(options.url);
+ if (xhr.status === 200) {
+ success(xhr, options);
+ } else {
+ failure(options.url);
+ }
}
};
@@ -397,7 +400,7 @@
}
};
- function cacheCurrentContent() {
+ function cacheCurrentContent () {
domCache[PUSH.id] = document.body.cloneNode(true);
}
@@ -472,7 +475,7 @@
document.body.insertBefore(swap, document.querySelector('.content'));
}
} else {
- enter = /in$/.test(transition);
+ enter = /in$/.test(transition);
if (transition === 'fade') {
container.classList.add('in');
@@ -490,7 +493,9 @@
}
if (!transition) {
- complete && complete();
+ if (complete) {
+ complete();
+ }
}
if (transition === 'fade') {
@@ -506,7 +511,9 @@
container.parentNode.removeChild(container);
swap.classList.remove('fade');
swap.classList.remove('in');
- complete && complete();
+ if (complete) {
+ complete();
+ }
};
container.addEventListener('webkitTransitionEnd', fadeContainerEnd);
@@ -518,7 +525,9 @@
swap.classList.remove('sliding', 'sliding-in');
swap.classList.remove(swapDirection);
container.parentNode.removeChild(container);
- complete && complete();
+ if (complete) {
+ complete();
+ }
};
container.offsetWidth; // force reflow
@@ -623,7 +632,11 @@
window.addEventListener('touchstart', function () { isScrolling = false; });
window.addEventListener('touchmove', function () { isScrolling = true; });
window.addEventListener('touchend', touchend);
- window.addEventListener('click', function (e) { if (getTarget(e)) {e.preventDefault();} });
+ window.addEventListener('click', function (e) {
+ if (getTarget(e)) {
+ e.preventDefault();
+ }
+ });
window.addEventListener('popstate', popstate);
window.PUSH = PUSH;
@@ -692,7 +705,12 @@
targetBody.classList.add(className);
});
- window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} });
+ window.addEventListener('click', function (e) {
+ if (getTarget(e.target)) {
+ e.preventDefault();
+ }
+ });
+
}());
/* ========================================================================
@@ -820,9 +838,7 @@
// we're done moving
startedMoving = false;
- setSlideNumber(
- (+new Date()) - startTime < 1000 && Math.abs(deltaX) > 15 ? (deltaX < 0 ? -1 : 1) : 0
- );
+ setSlideNumber((+new Date()) - startTime < 1000 && Math.abs(deltaX) > 15 ? (deltaX < 0 ? -1 : 1) : 0);
offsetX = slideNumber * sliderWidth;
@@ -950,7 +966,9 @@
toggle.classList[slideOn ? 'add' : 'remove']('active');
e = new CustomEvent('toggle', {
- detail: { isActive: slideOn },
+ detail: {
+ isActive: slideOn
+ },
bubbles: true,
cancelable: true
});
diff --git a/docs/dist/js/ratchet.js b/docs/dist/js/ratchet.js
index 85e8cfd..d865c64 100644
--- a/docs/dist/js/ratchet.js
+++ b/docs/dist/js/ratchet.js
@@ -103,8 +103,7 @@
try {
popover = document.querySelector(anchor.hash);
- }
- catch (error) {
+ } catch (error) {
popover = null;
}
@@ -370,7 +369,11 @@
clearTimeout(options._timeout);
}
if (xhr.readyState === 4) {
- xhr.status === 200 ? success(xhr, options) : failure(options.url);
+ if (xhr.status === 200) {
+ success(xhr, options);
+ } else {
+ failure(options.url);
+ }
}
};
@@ -397,7 +400,7 @@
}
};
- function cacheCurrentContent() {
+ function cacheCurrentContent () {
domCache[PUSH.id] = document.body.cloneNode(true);
}
@@ -472,7 +475,7 @@
document.body.insertBefore(swap, document.querySelector('.content'));
}
} else {
- enter = /in$/.test(transition);
+ enter = /in$/.test(transition);
if (transition === 'fade') {
container.classList.add('in');
@@ -490,7 +493,9 @@
}
if (!transition) {
- complete && complete();
+ if (complete) {
+ complete();
+ }
}
if (transition === 'fade') {
@@ -506,7 +511,9 @@
container.parentNode.removeChild(container);
swap.classList.remove('fade');
swap.classList.remove('in');
- complete && complete();
+ if (complete) {
+ complete();
+ }
};
container.addEventListener('webkitTransitionEnd', fadeContainerEnd);
@@ -518,7 +525,9 @@
swap.classList.remove('sliding', 'sliding-in');
swap.classList.remove(swapDirection);
container.parentNode.removeChild(container);
- complete && complete();
+ if (complete) {
+ complete();
+ }
};
container.offsetWidth; // force reflow
@@ -623,7 +632,11 @@
window.addEventListener('touchstart', function () { isScrolling = false; });
window.addEventListener('touchmove', function () { isScrolling = true; });
window.addEventListener('touchend', touchend);
- window.addEventListener('click', function (e) { if (getTarget(e)) {e.preventDefault();} });
+ window.addEventListener('click', function (e) {
+ if (getTarget(e)) {
+ e.preventDefault();
+ }
+ });
window.addEventListener('popstate', popstate);
window.PUSH = PUSH;
@@ -692,7 +705,12 @@
targetBody.classList.add(className);
});
- window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} });
+ window.addEventListener('click', function (e) {
+ if (getTarget(e.target)) {
+ e.preventDefault();
+ }
+ });
+
}());
/* ========================================================================
@@ -820,9 +838,7 @@
// we're done moving
startedMoving = false;
- setSlideNumber(
- (+new Date()) - startTime < 1000 && Math.abs(deltaX) > 15 ? (deltaX < 0 ? -1 : 1) : 0
- );
+ setSlideNumber((+new Date()) - startTime < 1000 && Math.abs(deltaX) > 15 ? (deltaX < 0 ? -1 : 1) : 0);
offsetX = slideNumber * sliderWidth;
@@ -950,7 +966,9 @@
toggle.classList[slideOn ? 'add' : 'remove']('active');
e = new CustomEvent('toggle', {
- detail: { isActive: slideOn },
+ detail: {
+ isActive: slideOn
+ },
bubbles: true,
cancelable: true
});