Fix random page reload, hopefully
This commit is contained in:
parent
6426237bf9
commit
1701df4630
|
@ -2,10 +2,10 @@ class PjaxAdapter extends Adapter {
|
||||||
constructor(store) {
|
constructor(store) {
|
||||||
super(['jquery.pjax.js'], store)
|
super(['jquery.pjax.js'], store)
|
||||||
|
|
||||||
$.pjax.defaults.timeout = 0 // no timeout
|
|
||||||
$(document)
|
$(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:end', () => $(document).trigger(EVENT.REQ_END))
|
||||||
|
.on('pjax:timeout', (e) => e.preventDefault())
|
||||||
}
|
}
|
||||||
|
|
||||||
// @override
|
// @override
|
||||||
|
@ -75,7 +75,8 @@ class PjaxAdapter extends Adapter {
|
||||||
$.pjax({
|
$.pjax({
|
||||||
// needs full path for pjax to work with Firefox as per cross-domain-content setting
|
// needs full path for pjax to work with Firefox as per cross-domain-content setting
|
||||||
url: location.protocol + '//' + location.host + path,
|
url: location.protocol + '//' + location.host + path,
|
||||||
container: $pjaxContainer
|
container: $pjaxContainer,
|
||||||
|
timeout: 0 // global timeout doesn't seem to work, use this instead
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -72,8 +72,6 @@ $(document).ready(() => {
|
||||||
.on(EVENT.LAYOUT_CHANGE, layoutChanged)
|
.on(EVENT.LAYOUT_CHANGE, layoutChanged)
|
||||||
.on(EVENT.TOGGLE, layoutChanged)
|
.on(EVENT.TOGGLE, layoutChanged)
|
||||||
.on(EVENT.LOC_CHANGE, () => tryLoadRepo())
|
.on(EVENT.LOC_CHANGE, () => tryLoadRepo())
|
||||||
// This seems to fix intermitten page reload #342
|
|
||||||
.on('pjax:reload', (e) => e.preventDefault())
|
|
||||||
|
|
||||||
$sidebar
|
$sidebar
|
||||||
.width(parseInt(store.get(STORE.WIDTH)))
|
.width(parseInt(store.get(STORE.WIDTH)))
|
||||||
|
|
Loading…
Reference in New Issue