From 02fabcca8d7f03b5b949333cb5af3835943c0e27 Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Tue, 16 Sep 2014 07:54:12 +0200 Subject: [PATCH] prepare 0.1.3 & rename ` clickReload` to `currentUrlFullReload` --- CHANGELOG.md | 5 +++++ README.md | 4 ++++ src/pjax.js | 6 ++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 341dabb..0be5520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.1.3 - 2014-09-16 + +- clicking on the current url somewhere does not produce a full reload by default (see option `currentUrlFullReload`) +- fix `document.implementation.createHTMLDocument` error (in IE10, ref [#16](https://github.com/MoOx/pjax/pull/16)) + ## 0.1.2 - 2014-04-03 - pjax.js relocated in `src/` diff --git a/README.md b/README.md index 038c145..32fb5b2 100644 --- a/README.md +++ b/README.md @@ -388,6 +388,10 @@ Value (in px) to scrollTo when a page is switched. Enable verbose mode & doesn't use fallback when there is an error. Useful to debug page layout differences. +##### `currentUrlFullReload` (Boolean, default to false) + +When set to true, clicking on a link that point the current url trigger a full page reload. + #### Extend Pjax Pjax prototype & utilities methods can be used & changed so you can patch or hack diff --git a/src/pjax.js b/src/pjax.js index 6c29faf..2f6464e 100644 --- a/src/pjax.js +++ b/src/pjax.js @@ -27,7 +27,7 @@ this.options.switches = this.options.switches || {} this.options.switchesOptions = this.options.switchesOptions || {} this.options.history = this.options.history || true - this.options.clickReload = this.options.clickReload || false + this.options.currentUrlFullReload = this.options.currentUrlFullReload || false this.options.analytics = this.options.analytics || function(options) { // options.backward or options.foward can be true or undefined // by default, we do track back/foward hit @@ -272,9 +272,7 @@ event.preventDefault() - // If options.clickReload is true, when a user click twice on a link, - // try to reload the page. Otherwise, do nothing. - if (this.options.clickReload) { + if (this.options.currentUrlFullReload) { if (el.href === window.location.href) { window.location.reload() return -6