|
55 | 55 | :has-previous="hasPrevious" |
56 | 56 | :inline-actions="canEdit ? 1 : 0" |
57 | 57 | :spread-navigation="true" |
58 | | - :style="{ width: isSidebarShown ? `calc(100% - ${sidebarWidth}px)` : null }" |
| 58 | + :style="{ width: isSidebarShown ? `${sidebarPosition}px` : null }" |
59 | 59 | :title="currentFile.basename" |
60 | 60 | :view="currentFile.modal" |
61 | 61 | class="viewer" |
@@ -219,7 +219,7 @@ export default { |
219 | 219 | cancelRequestFolder: () => {}, |
220 | 220 |
|
221 | 221 | // Flags |
222 | | - sidebarWidth: 0, |
| 222 | + sidebarPosition: 0, |
223 | 223 | isSidebarShown: false, |
224 | 224 | canSwipe: true, |
225 | 225 | isStandalone: !(OCA && OCA.Files && 'fileActions' in OCA.Files), |
@@ -921,21 +921,21 @@ export default { |
921 | 921 | this.isSidebarShown = true |
922 | 922 | const sidebar = document.querySelector('aside.app-sidebar') |
923 | 923 | if (sidebar) { |
924 | | - this.sidebarWidth = sidebar.offsetWidth |
| 924 | + this.sidebarPosition = sidebar.getBoundingClientRect().left |
925 | 925 | this.trapElements = [sidebar] |
926 | 926 | } |
| 927 | + this.updateSidebarPosition() |
927 | 928 | }, |
928 | 929 |
|
929 | 930 | handleAppSidebarClose() { |
930 | 931 | this.isSidebarShown = false |
931 | 932 | this.trapElements = [] |
932 | 933 | }, |
933 | 934 |
|
934 | | - onResize(event) { |
935 | | - // update sidebar width |
| 935 | + onResize() { |
936 | 936 | const sidebar = document.querySelector('aside.app-sidebar') |
937 | 937 | if (sidebar) { |
938 | | - this.sidebarWidth = sidebar.offsetWidth |
| 938 | + this.sidebarPosition = sidebar.getBoundingClientRect().left |
939 | 939 | } |
940 | 940 | }, |
941 | 941 |
|
|
0 commit comments