Fix item pane size when switching to note in stacked mode
This commit is contained in:
parent
f59ee25fd7
commit
7f58873e0b
1 changed files with 15 additions and 4 deletions
|
@ -1973,14 +1973,25 @@ var ZoteroPane = new function()
|
|||
}
|
||||
}
|
||||
|
||||
const sidenavWidth = 37;
|
||||
let isStackedMode = Zotero.Prefs.get("layout") === "stacked";
|
||||
const sidenavSize = 37;
|
||||
if (hideSidenav && !sidenav.hidden) {
|
||||
sidenav.hidden = true;
|
||||
pane.width = `${(pane.clientWidth) + sidenavWidth}`;
|
||||
if (isStackedMode) {
|
||||
pane.height = `${(pane.clientHeight) + sidenavSize}`;
|
||||
}
|
||||
else {
|
||||
pane.width = `${(pane.clientWidth) + sidenavSize}`;
|
||||
}
|
||||
}
|
||||
else if (!hideSidenav && sidenav.hidden) {
|
||||
sidenav.hidden = false;
|
||||
pane.width = `${pane.clientWidth - sidenavWidth}`;
|
||||
if (isStackedMode) {
|
||||
pane.height = `${(pane.clientHeight) - sidenavSize}`;
|
||||
}
|
||||
else {
|
||||
pane.width = `${(pane.clientWidth) - sidenavSize}`;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -1993,7 +2004,7 @@ var ZoteroPane = new function()
|
|||
.finally(function () {
|
||||
return this.itemsView.runListeners('select');
|
||||
}.bind(this));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue