@@ -43,10 +50,12 @@ export default {
type: Number,
default: 120
},
+ expandOnClick: Boolean,
bookCoverAspectRatio: Number
},
data() {
return {
+ showImageModal: false,
loading: true,
imageFailed: false,
showCoverBg: false,
@@ -102,6 +111,11 @@ export default {
var store = this.$store || this.$nuxt.$store
return store.getters['globals/getLibraryItemCoverSrc'](this.libraryItem, this.placeholderUrl)
},
+ rawCoverUrl() {
+ if (!this.libraryItem) return null
+ var store = this.$store || this.$nuxt.$store
+ return store.getters['globals/getLibraryItemCoverSrc'](this.libraryItem, null, true)
+ },
cover() {
return this.media.coverPath || this.placeholderUrl
},
@@ -132,6 +146,9 @@ export default {
}
},
methods: {
+ clickCover() {
+ this.showImageModal = true
+ },
setCoverBg() {
if (this.$refs.coverBg) {
this.$refs.coverBg.style.backgroundImage = `url("${this.fullCoverUrl}")`
diff --git a/client/pages/item/_id/index.vue b/client/pages/item/_id/index.vue
index 0f4f17b2..eff240f7 100644
--- a/client/pages/item/_id/index.vue
+++ b/client/pages/item/_id/index.vue
@@ -3,21 +3,21 @@
-
-
+
diff --git a/client/store/globals.js b/client/store/globals.js
index a202d685..44b35f88 100644
--- a/client/store/globals.js
+++ b/client/store/globals.js
@@ -80,7 +80,7 @@ export const state = () => ({
})
export const getters = {
- getLibraryItemCoverSrc: (state, getters, rootState, rootGetters) => (libraryItem, placeholder = null) => {
+ getLibraryItemCoverSrc: (state, getters, rootState, rootGetters) => (libraryItem, placeholder = null, raw = false) => {
if (!placeholder) placeholder = `${rootState.routerBasePath}/book_placeholder.jpg`
if (!libraryItem) return placeholder
const media = libraryItem.media
@@ -94,7 +94,7 @@ export const getters = {
const libraryItemId = libraryItem.libraryItemId || libraryItem.id // Workaround for /users/:id page showing media progress covers
if (process.env.NODE_ENV !== 'production') { // Testing
- return `http://localhost:3333${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}&ts=${lastUpdate}`
+ return `http://localhost:3333${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}&ts=${lastUpdate}${raw ? '&raw=1' : ''}`
}
return `${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}&ts=${lastUpdate}`