Browse Source

Use plain `if/else` statements when there's no assignment.

pull/521/head
XhmikosR 11 years ago committed by XhmikosR
parent
commit
787bc8309c
  1. 4
      docs/assets/js/docs.js
  2. 18
      js/push.js

4
docs/assets/js/docs.js

@ -185,6 +185,8 @@ $(function () {
$(window).on('load resize', initialize);
$(window).on('load', function () {
window.FingerBlast && (new FingerBlast('.device-content'));
if (window.FingerBlast) {
new FingerBlast('.device-content');
}
});
});

18
js/push.js

@ -231,7 +231,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);
}
}
};
@ -351,7 +355,9 @@
}
if (!transition) {
complete && complete();
if (complete) {
complete();
}
}
if (transition === 'fade') {
@ -367,7 +373,9 @@
container.parentNode.removeChild(container);
swap.classList.remove('fade');
swap.classList.remove('in');
complete && complete();
if (complete) {
complete();
}
};
container.addEventListener('webkitTransitionEnd', fadeContainerEnd);
@ -379,7 +387,9 @@
swap.classList.remove('sliding', 'sliding-in');
swap.classList.remove(swapDirection);
container.parentNode.removeChild(container);
complete && complete();
if (complete) {
complete();
}
};
container.offsetWidth; // force reflow

Loading…
Cancel
Save