Skip to content

Commit 6bc86fe

Browse files
committed
Remember position of collapse/expand across pages
1 parent d8c07cf commit 6bc86fe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

templates/html/resize.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,17 @@ function initResizable()
109109

110110
function collapseExpand()
111111
{
112+
var newWidth;
112113
if (sidenav.width()>0) {
113-
restoreWidth(0);
114+
newWidth=0;
114115
}
115116
else {
116117
var width = readSetting('width');
117-
if (width>$TREEVIEW_WIDTH && width<$(window).width()) { restoreWidth(width); } else { restoreWidth($TREEVIEW_WIDTH); }
118+
newWidth = (width>$TREEVIEW_WIDTH && width<$(window).width()) ? width : $TREEVIEW_WIDTH;
118119
}
120+
restoreWidth(newWidth);
121+
var sidenavWidth = $(sidenav).outerWidth();
122+
writeSetting('width',sidenavWidth-barWidth);
119123
}
120124

121125
header = $("#top");

0 commit comments

Comments
 (0)