|
26 | 26 | v-if="initiated || currentFile.modal" |
27 | 27 | id="viewer-content" |
28 | 28 | :class="{'icon-loading': !currentFile.loaded && !currentFile.failed}" |
| 29 | + :clear-view-delay="isTesting ? -1 : 5000 /* prevent cypress timeouts */" |
29 | 30 | :dark="true" |
30 | | - :view="currentFile.modal" |
31 | 31 | :enable-slideshow="hasPrevious || hasNext" |
32 | | - :spread-navigation="true" |
33 | | - :has-previous="hasPrevious" |
34 | | - :has-next="hasNext" |
35 | | - :title="currentFile.basename" |
36 | 32 | :enable-swipe="canSwipe" |
| 33 | + :has-next="hasNext" |
| 34 | + :has-previous="hasPrevious" |
37 | 35 | :size="isMobile ? 'full' : 'large'" |
| 36 | + :spread-navigation="true" |
38 | 37 | :style="{width: isSidebarShown ? `calc(100% - ${sidebarWidth}px)` : null}" |
| 38 | + :title="currentFile.basename" |
| 39 | + :view="currentFile.modal" |
39 | 40 | @close="close" |
40 | 41 | @previous="previous" |
41 | 42 | @next="next"> |
@@ -129,35 +130,37 @@ export default { |
129 | 130 | mixins: [isMobile, isFullscreen], |
130 | 131 |
|
131 | 132 | data: () => ({ |
132 | | - // reactivity bindings |
| 133 | + // Reactivity bindings |
133 | 134 | Viewer: OCA.Viewer.state, |
134 | 135 | Sidebar: null, |
135 | 136 | handlers: OCA.Viewer.availableHandlers, |
136 | 137 |
|
| 138 | + // Viewer variables |
137 | 139 | components: {}, |
138 | 140 | mimeGroups: {}, |
139 | 141 | registeredHandlers: [], |
140 | 142 |
|
| 143 | + // Files variables |
141 | 144 | currentIndex: 0, |
142 | 145 | previousFile: {}, |
143 | 146 | currentFile: {}, |
144 | 147 | nextFile: {}, |
145 | | -
|
146 | 148 | fileList: [], |
147 | 149 |
|
| 150 | + // States |
148 | 151 | isLoaded: false, |
149 | 152 | initiated: false, |
150 | 153 |
|
151 | 154 | // cancellable requests |
152 | 155 | cancelRequestFile: () => {}, |
153 | 156 | cancelRequestFolder: () => {}, |
154 | 157 |
|
155 | | - isSidebarShown: false, |
| 158 | + // Flags |
156 | 159 | sidebarWidth: 0, |
157 | | -
|
| 160 | + isSidebarShown: false, |
158 | 161 | canSwipe: true, |
159 | | -
|
160 | | - standalone: !(OCA && OCA.Files && 'fileActions' in OCA.Files), |
| 162 | + isStandalone: !(OCA && OCA.Files && 'fileActions' in OCA.Files), |
| 163 | + isTesting, |
161 | 164 |
|
162 | 165 | root: getRootPath(), |
163 | 166 | }), |
@@ -284,7 +287,7 @@ export default { |
284 | 287 |
|
285 | 288 | window.addEventListener('resize', this.onResize) |
286 | 289 |
|
287 | | - if (this.standalone) { |
| 290 | + if (this.isStandalone) { |
288 | 291 | console.debug('No OCA.Files app found, viewer is now in standalone mode') |
289 | 292 | } |
290 | 293 | }, |
@@ -545,7 +548,7 @@ export default { |
545 | 548 | }, |
546 | 549 |
|
547 | 550 | registerAction({ mime, group }) { |
548 | | - if (!this.standalone) { |
| 551 | + if (!this.isStandalone) { |
549 | 552 | // unregistered handler, let's go! |
550 | 553 | OCA.Files.fileActions.registerAction({ |
551 | 554 | name: 'view', |
|
0 commit comments