mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-01 16:44:41 +02:00
Finish lazy bookshelf,Fix:Async sql db,Fix:Load user progress
This commit is contained in:
parent
37d3021302
commit
3232b519d3
42 changed files with 613 additions and 1878 deletions
|
@ -21,7 +21,7 @@ export default {
|
|||
var shelf = Math.floor(index / this.entitiesPerShelf)
|
||||
var shelfEl = document.getElementById(`shelf-${shelf}`)
|
||||
if (!shelfEl) {
|
||||
console.error('invalid shelf', shelf, 'book index', index)
|
||||
console.error('mount entity card invalid shelf', shelf, 'book index', index)
|
||||
return
|
||||
}
|
||||
this.entityIndexesMounted.push(index)
|
||||
|
@ -43,7 +43,9 @@ export default {
|
|||
}
|
||||
var shelfOffsetY = this.isBookEntity ? 24 : 16
|
||||
var row = index % this.entitiesPerShelf
|
||||
var shelfOffsetX = row * this.totalEntityCardWidth + this.bookshelfMarginLeft
|
||||
|
||||
var marginShiftLeft = 12
|
||||
var shelfOffsetX = row * this.totalEntityCardWidth + this.bookshelfMarginLeft + marginShiftLeft
|
||||
|
||||
var ComponentClass = this.getComponentClass()
|
||||
var props = {
|
||||
|
@ -67,10 +69,10 @@ export default {
|
|||
}
|
||||
})
|
||||
this.entityComponentRefs[index] = instance
|
||||
|
||||
instance.$mount()
|
||||
instance.$el.style.transform = `translate3d(${shelfOffsetX}px, ${shelfOffsetY}px, 0px)`
|
||||
instance.$el.classList.add('absolute', 'top-0', 'left-0', 'mx-3')
|
||||
|
||||
instance.$el.classList.add('absolute', 'top-0', 'left-0')
|
||||
shelfEl.appendChild(instance.$el)
|
||||
|
||||
if (this.entities[index]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue