Fix random double page reload (#451)

fixes buunguyen/octotree#342
This commit is contained in:
Abimbola Idowu 2018-03-08 04:39:59 +01:00 committed by Buu Nguyen
parent dea290ef6e
commit 0a7683292a
2 changed files with 3 additions and 1 deletions

View File

@ -41,5 +41,6 @@ const EVENT = {
OPTS_CHANGE : 'octotree:change',
VIEW_READY : 'octotree:ready',
VIEW_CLOSE : 'octotree:close',
FETCH_ERROR : 'octotree:error'
FETCH_ERROR : 'octotree:error',
PJAX_RELOAD : 'pjax:reload'
}

View File

@ -72,6 +72,7 @@ $(document).ready(() => {
.on(EVENT.LAYOUT_CHANGE, layoutChanged)
.on(EVENT.TOGGLE, layoutChanged)
.on(EVENT.LOC_CHANGE, () => tryLoadRepo())
.on(EVENT.PJAX_RELOAD, (e) => e.preventDefault())
$sidebar
.width(parseInt(store.get(STORE.WIDTH)))