From ea7d1d2fce0bb3f9e61e642653e2cef7fc4e9806 Mon Sep 17 00:00:00 2001 From: Isaac Gierard Date: Tue, 18 Nov 2014 14:45:50 -0800 Subject: [PATCH] prevent scrollTo from being converted from false to 0 In the loadUrl function there is an explicit check for false as a means to disable the scrollTo behavior however if the scrollTo option is passed to the constructor as false the gaud statement was converting false to 0. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 94bcc09..be22d7c 100644 --- a/index.js +++ b/index.js @@ -26,7 +26,7 @@ var Pjax = function(options) { ga("send", "pageview", {page: options.url, title: options.title}) } } - this.options.scrollTo = this.options.scrollTo || 0 + this.options.scrollTo = (typeof this.options.scrollTo === 'undefined') ? 0 : this.options.scrollTo; this.options.debug = this.options.debug || false this.maxUid = this.lastUid = newUid()