mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 00:02:15 +00:00
- reverse pdf zoom icons
- store pdf zoom level into localstorage
This commit is contained in:
@@ -194,27 +194,40 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getDocumentSize() {
|
||||
|
||||
if (window.innerWidth < 960) {
|
||||
this.documentSize = 100
|
||||
}
|
||||
|
||||
if (window.innerWidth > 960){
|
||||
this.documentSize = localStorage.getItem('documentSize')
|
||||
? parseInt(localStorage.getItem('documentSize'))
|
||||
: 50;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
// Set zoom size
|
||||
this.documentSize = window.innerWidth < 960 ? 100 : 50
|
||||
|
||||
events.$on('file-preview:next', () => this.next())
|
||||
events.$on('file-preview:next', () => this.next())
|
||||
events.$on('file-preview:prev', () => this.prev())
|
||||
|
||||
events.$on('document-zoom:in', () => {
|
||||
if (this.documentSize < 100)
|
||||
this.documentSize += 10
|
||||
if (this.documentSize < 100) {
|
||||
this.documentSize += 10
|
||||
localStorage.setItem('documentSize', this.documentSize)
|
||||
}
|
||||
})
|
||||
|
||||
events.$on('document-zoom:out', () => {
|
||||
if (this.documentSize > 40)
|
||||
this.documentSize -= 10
|
||||
if (this.documentSize > 40) {
|
||||
this.documentSize -= 10
|
||||
localStorage.setItem('documentSize', this.documentSize)
|
||||
}
|
||||
})
|
||||
|
||||
this.getDocumentSize()
|
||||
this.getFilesForView()
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
<div class="navigation-icons">
|
||||
<div v-if="isPdf" class="navigation-tool-wrapper">
|
||||
<ToolbarButton @click.native="increaseSizeOfPDF" source="zoom-in" :action="$t('pdf_zoom_in')" />
|
||||
<ToolbarButton @click.native="decreaseSizeOfPDF" source="zoom-out" :action="$t('pdf_zoom_out')" />
|
||||
<ToolbarButton @click.native="increaseSizeOfPDF" source="zoom-in" :action="$t('pdf_zoom_in')" />
|
||||
</div>
|
||||
<div class="navigation-tool-wrapper">
|
||||
<ToolbarButton @click.native="downloadItem" class="mobile-hide" source="download" :action="$t('actions.download')" />
|
||||
|
||||
Reference in New Issue
Block a user