Skip to content

Commit

Permalink
Fix no close option on app pdf-viewer (#7201)
Browse files Browse the repository at this point in the history
Add toolbar with filename and close button to app pdf-viewer
  • Loading branch information
Jan authored Jun 30, 2022
1 parent d1b2339 commit c189532
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
7 changes: 7 additions & 0 deletions changelog/unreleased/enhancement-pdf-viewer-app-toolbar
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Added a toolbar to pdf-viewer app

We've added a toolbar to the pdf-viewer app,
where the user can see the name of the opened pdf file and also close the app.

https://github.com/owncloud/web/pull/7201
https://github.com/owncloud/web/issues/7198
27 changes: 20 additions & 7 deletions packages/web-app-pdf-viewer/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
<main>
<loading-screen v-if="loading" />
<error-screen v-else-if="loadingError" />
<object
v-else
class="pdf-viewer oc-width-1-1 oc-height-1-1"
:data="blobUrl"
type="application/pdf"
/>
<div v-else class="oc-height-1-1">
<div class="oc-flex oc-p-s pdf-viewer-tool-bar">
<span>{{ fileName }}</span>
<oc-button id="text-editor-controls-close" size="small" @click="closeApp">
<oc-icon name="close" size="small" />
</oc-button>
</div>
<object class="pdf-viewer oc-width-1-1" :data="blobUrl" type="application/pdf" />
</div>
</main>
</template>
<script>
Expand Down Expand Up @@ -36,7 +39,11 @@ export default {
blobUrl: ''
}),
computed: {
...mapGetters(['getToken'])
...mapGetters(['getToken']),
fileName() {
return this.currentFileContext.fileName
}
},
created() {
this.loadPdf(this.currentFileContext)
Expand Down Expand Up @@ -69,5 +76,11 @@ export default {
margin: 0;
padding: 0;
overflow: hidden;
height: calc(100% - 50px);
}
.pdf-viewer-tool-bar {
align-items: center;
justify-content: space-between;
}
</style>

0 comments on commit c189532

Please sign in to comment.