diff --git a/src/adapters/pjax.js b/src/adapters/pjax.js index 80b82ef..78a9bc4 100644 --- a/src/adapters/pjax.js +++ b/src/adapters/pjax.js @@ -2,10 +2,10 @@ class PjaxAdapter extends Adapter { constructor(store) { super(['jquery.pjax.js'], store) - $.pjax.defaults.timeout = 0 // no timeout $(document) - .on('pjax:send', () => $(document).trigger(EVENT.REQ_START)) + .on('pjax:start', () => $(document).trigger(EVENT.REQ_START)) .on('pjax:end', () => $(document).trigger(EVENT.REQ_END)) + .on('pjax:timeout', (e) => e.preventDefault()) } // @override @@ -75,7 +75,8 @@ class PjaxAdapter extends Adapter { $.pjax({ // needs full path for pjax to work with Firefox as per cross-domain-content setting url: location.protocol + '//' + location.host + path, - container: $pjaxContainer + container: $pjaxContainer, + timeout: 0 // global timeout doesn't seem to work, use this instead }) } else { diff --git a/src/octotree.js b/src/octotree.js index b833837..c546c10 100755 --- a/src/octotree.js +++ b/src/octotree.js @@ -72,8 +72,6 @@ $(document).ready(() => { .on(EVENT.LAYOUT_CHANGE, layoutChanged) .on(EVENT.TOGGLE, layoutChanged) .on(EVENT.LOC_CHANGE, () => tryLoadRepo()) - // This seems to fix intermitten page reload #342 - .on('pjax:reload', (e) => e.preventDefault()) $sidebar .width(parseInt(store.get(STORE.WIDTH)))