Skip to content

Commit beb932e

Browse files
committed
Fix bug sidebar width not stable in firefox
1 parent 879a2bb commit beb932e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/octotree.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $(document).ready(() => {
7575

7676
$sidebar
7777
.width(parseInt(store.get(STORE.WIDTH)))
78-
.resize(layoutChanged)
78+
.resize(() => layoutChanged(true))
7979
.appendTo($('body'))
8080

8181
adapter.init($sidebar)
@@ -173,10 +173,12 @@ $(document).ready(() => {
173173
}
174174
}
175175

176-
function layoutChanged() {
176+
function layoutChanged(save = false) {
177177
const width = $sidebar.outerWidth()
178178
adapter.updateLayout(isTogglerVisible(), isSidebarVisible(), width)
179-
store.set(STORE.WIDTH, width)
179+
if (save === true) {
180+
store.set(STORE.WIDTH, width)
181+
}
180182
}
181183

182184
function isSidebarVisible() {

0 commit comments

Comments
 (0)