From 787bc8309c807a25fa6e5e811aa4f59ec0cd42cb Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 24 Mar 2014 08:22:55 +0200 Subject: [PATCH] Use plain `if/else` statements when there's no assignment. --- docs/assets/js/docs.js | 4 +++- js/push.js | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/assets/js/docs.js b/docs/assets/js/docs.js index 094d15a..753ffba 100644 --- a/docs/assets/js/docs.js +++ b/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'); + } }); }); diff --git a/js/push.js b/js/push.js index 818f4ea..ba60100 100644 --- a/js/push.js +++ b/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