diff --git a/js/.jshintrc b/js/.jshintrc index 2eac213..a9d8cde 100644 --- a/js/.jshintrc +++ b/js/.jshintrc @@ -4,7 +4,6 @@ "devel" : true, "eqeqeq" : true, "expr" : true, - "forin" : true, "freeze" : true, "latedef" : true, "nonbsp" : true, diff --git a/js/push.js b/js/push.js index c1a56d8..dae47fc 100644 --- a/js/push.js +++ b/js/push.js @@ -175,13 +175,11 @@ if (transitionFromObj.transition) { activeObj = extendWithDom(activeObj, '.content', activeDom.cloneNode(true)); for (key in bars) { - if (bars.hasOwnProperty(key)) { - barElement = document.querySelector(bars[key]); - if (activeObj[key]) { - swapContent(activeObj[key], barElement); - } else if (barElement) { - barElement.parentNode.removeChild(barElement); - } + barElement = document.querySelector(bars[key]); + if (activeObj[key]) { + swapContent(activeObj[key], barElement); + } else if (barElement) { + barElement.parentNode.removeChild(barElement); } } } @@ -208,9 +206,7 @@ options.container = options.container || options.transition ? document.querySelector('.content') : document.body; for (key in bars) { - if (bars.hasOwnProperty(key)) { - options[key] = options[key] || document.querySelector(bars[key]); - } + options[key] = options[key] || document.querySelector(bars[key]); } if (xhr && xhr.readyState < 4) { @@ -271,13 +267,11 @@ if (options.transition) { for (key in bars) { - if (bars.hasOwnProperty(key)) { - barElement = document.querySelector(bars[key]); - if (data[key]) { - swapContent(data[key], barElement); - } else if (barElement) { - barElement.parentNode.removeChild(barElement); - } + barElement = document.querySelector(bars[key]); + if (data[key]) { + swapContent(data[key], barElement); + } else if (barElement) { + barElement.parentNode.removeChild(barElement); } } } @@ -414,9 +408,7 @@ var result = {}; for (i in obj) { - if (obj.hasOwnProperty(i)) { - result[i] = obj[i]; - } + result[i] = obj[i]; } Object.keys(bars).forEach(function (key) {