From 778734419de314d4cb64d07109bbab73f8e2e42a Mon Sep 17 00:00:00 2001 From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com> Date: Tue, 18 Aug 2020 12:47:23 +0000 Subject: [PATCH 1/2] feat: preview mobile dropdown --- frontend/src/components/Header.vue | 3 ++- frontend/src/components/files/Preview.vue | 25 +++++++++++++++++++---- frontend/src/store/getters.js | 1 + 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/Header.vue b/frontend/src/components/Header.vue index d9542864..0866fdba 100644 --- a/frontend/src/components/Header.vue +++ b/frontend/src/components/Header.vue @@ -1,5 +1,5 @@ + +
@@ -109,6 +117,9 @@ export default { }, raw () { return `${this.previewUrl}&inline=true` + }, + showMore () { + return this.$store.state.show === 'more' } }, watch: { @@ -189,6 +200,12 @@ export default { return } + }, + openMore () { + this.$store.commit('showHover', 'more') + }, + resetPrompts () { + this.$store.commit('closeHovers') } } } diff --git a/frontend/src/store/getters.js b/frontend/src/store/getters.js index 0f9925f4..11ad60ab 100644 --- a/frontend/src/store/getters.js +++ b/frontend/src/store/getters.js @@ -3,6 +3,7 @@ const getters = { isFiles: state => !state.loading && state.route.name === 'Files', isListing: (state, getters) => getters.isFiles && state.req.isDir, isEditor: (state, getters) => getters.isFiles && (state.req.type === 'text' || state.req.type === 'textImmutable'), + isPreview: state => state.previewMode, selectedCount: state => state.selected.length, progress : state => { if (state.upload.progress.length == 0) { From 3d2cb838d111ee61047599f49e76de80c821f341 Mon Sep 17 00:00:00 2001 From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com> Date: Tue, 18 Aug 2020 13:08:58 +0000 Subject: [PATCH 2/2] feat: preview size button --- .../src/components/buttons/PreviewSize.vue | 22 +++++++++++++++++++ .../src/components/files/ExtendedImage.vue | 7 ++++++ frontend/src/components/files/Preview.vue | 16 +++++++++++--- frontend/src/utils/constants.js | 4 +++- http/static.go | 1 + 5 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 frontend/src/components/buttons/PreviewSize.vue diff --git a/frontend/src/components/buttons/PreviewSize.vue b/frontend/src/components/buttons/PreviewSize.vue new file mode 100644 index 00000000..3183b56f --- /dev/null +++ b/frontend/src/components/buttons/PreviewSize.vue @@ -0,0 +1,22 @@ + + + diff --git a/frontend/src/components/files/ExtendedImage.vue b/frontend/src/components/files/ExtendedImage.vue index aeb27981..4cfe247e 100644 --- a/frontend/src/components/files/ExtendedImage.vue +++ b/frontend/src/components/files/ExtendedImage.vue @@ -77,6 +77,13 @@ export default { window.removeEventListener('resize', this.onResize) document.removeEventListener('mouseup', this.onMouseUp) }, + watch: { + src: function () { + this.scale = 1 + this.setZoom() + this.setCenter() + } + }, methods: { onLoad() { let img = this.$refs.imgex diff --git a/frontend/src/components/files/Preview.vue b/frontend/src/components/files/Preview.vue index 519e259a..7a2ded1b 100644 --- a/frontend/src/components/files/Preview.vue +++ b/frontend/src/components/files/Preview.vue @@ -9,6 +9,7 @@ {{ this.name }} + @@ -65,8 +66,9 @@