-
{{ title }}
+
@@ -30,6 +30,8 @@ export default {
return {
processing: false,
libraryItem: null,
+ availableHeight: 0,
+ marginTop: 0,
tabs: [
{
id: 'details',
@@ -133,8 +135,7 @@ export default {
})
},
height() {
- var maxHeightAllowed = window.innerHeight - 150
- return Math.min(maxHeightAllowed, 650)
+ return Math.min(this.availableHeight, 650)
},
tabName() {
var _tab = this.tabs.find((t) => t.id === this.selectedTab)
@@ -246,15 +247,29 @@ export default {
}
},
registerListeners() {
+ window.addEventListener('orientationchange', this.orientationChange)
this.$eventBus.$on('modal-hotkey', this.hotkey)
this.$eventBus.$on(`${this.selectedLibraryItemId}_updated`, this.libraryItemUpdated)
},
unregisterListeners() {
+ window.removeEventListener('orientationchange', this.orientationChange)
this.$eventBus.$off('modal-hotkey', this.hotkey)
this.$eventBus.$off(`${this.selectedLibraryItemId}_updated`, this.libraryItemUpdated)
+ },
+ orientationChange() {
+ setTimeout(this.setHeight, 50)
+ },
+ setHeight() {
+ const smAndBelow = window.innerWidth < 1024 && window.innerWidth > window.innerHeight
+
+ this.marginTop = smAndBelow ? 90 : 75
+ const heightModifier = smAndBelow ? 95 : 150
+ this.availableHeight = window.innerHeight - heightModifier
}
},
- mounted() {},
+ mounted() {
+ this.setHeight()
+ },
beforeDestroy() {
this.unregisterListeners()
}
diff --git a/client/components/widgets/BookDetailsEdit.vue b/client/components/widgets/BookDetailsEdit.vue
index 2b7d4207..0d78635a 100644
--- a/client/components/widgets/BookDetailsEdit.vue
+++ b/client/components/widgets/BookDetailsEdit.vue
@@ -11,7 +11,7 @@