From 55a49beed067f4595796519db7af8bc6083a01fb Mon Sep 17 00:00:00 2001 From: Evgeny Zhlobo Date: Sun, 9 Dec 2012 15:23:47 +0300 Subject: [PATCH] Add braces to all if --- shower.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shower.js b/shower.js index 87d092c..2bd5e47 100755 --- a/shower.js +++ b/shower.js @@ -379,8 +379,9 @@ window.shower = (function(window, document, undefined) { // NOTE: we should update hash to get things work properly url.hash = '#' + slideId; - if (isHistoryApiSupported) + if (isHistoryApiSupported) { history.replaceState(null, null, url.pathname + '?full#' + slideId); + } shower.enterSlideMode(); shower.updateProgress(shower.getCurrentSlideNumber()); @@ -456,8 +457,9 @@ window.shower = (function(window, document, undefined) { if ( ! shower.isListMode()) { // "?full" is present without slide hash, so we should display first slide if (-1 === shower.getCurrentSlideNumber()) { - if (isHistoryApiSupported) + if (isHistoryApiSupported) { history.replaceState(null, null, url.pathname + '?full' + shower.getSlideHash(0)); + } } shower.enterSlideMode(); @@ -519,8 +521,9 @@ window.shower = (function(window, document, undefined) { if (shower.isListMode() && -1 !== currentSlideNumber) { e.preventDefault(); - if (isHistoryApiSupported) + if (isHistoryApiSupported) { history.pushState(null, null, url.pathname + '?full' + shower.getSlideHash(currentSlideNumber)); + } shower.enterSlideMode(); shower.updateProgress(currentSlideNumber); @@ -533,8 +536,9 @@ window.shower = (function(window, document, undefined) { if ( ! shower.isListMode()) { e.preventDefault(); - if (isHistoryApiSupported) + if (isHistoryApiSupported) { history.pushState(null, null, url.pathname + shower.getSlideHash(currentSlideNumber)); + } shower.enterListMode(); shower.scrollToSlide(currentSlideNumber); }