Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix no close option on app pdf-viewer #7201

Merged
merged 6 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>