Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display preview on hover #3173

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions client/components/app/BookShelfToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export default {
}

this.addSubtitlesMenuItem(items)
this.addDetailsOnHoverMenuItem(items)
this.addCollapseSubSeriesMenuItem(items)

return items
Expand Down Expand Up @@ -329,6 +330,7 @@ export default {

this.addSubtitlesMenuItem(items)
this.addCollapseSeriesMenuItem(items)
this.addDetailsOnHoverMenuItem(items)

return items
},
Expand Down Expand Up @@ -367,6 +369,21 @@ export default {
}
}
},
addDetailsOnHoverMenuItem(items) {
if (this.isBookLibrary && (!this.page || this.page === 'search')) {
if (this.settings.showDetailsOnHover) {
items.push({
text: this.$strings.LabelHideDetailsOnHover,
action: 'hide-details-on-hover'
})
} else {
items.push({
text: this.$strings.LabelShowDetailsOnHover,
action: 'show-details-on-hover'
})
}
}
},
addCollapseSubSeriesMenuItem(items) {
if (this.selectedSeries && this.isBookLibrary && !this.isBatchSelecting) {
if (this.settings.collapseBookSeries) {
Expand Down Expand Up @@ -408,6 +425,19 @@ export default {
}
return false
},
handleDetailsOnHoverAction(action) {
if (action === 'show-details-on-hover') {
this.settings.showDetailsOnHover = true
this.updateShowDetailsOnHover()
return true
}
if (action === 'hide-details-on-hover') {
this.settings.showDetailsOnHover = false
this.updateShowDetailsOnHover()
return true
}
return false
},
handleCollapseSubSeriesAction(action) {
if (action === 'collapse-sub-series') {
this.settings.collapseBookSeries = true
Expand All @@ -429,6 +459,8 @@ export default {
return
} else if (this.handleCollapseSeriesAction(action)) {
return
} else if (this.handleDetailsOnHoverAction(action)) {
return
}
},
exportOPML() {
Expand All @@ -451,6 +483,8 @@ export default {
this.markSeriesFinished()
} else if (this.handleSubtitlesAction(action)) {
return
} else if (this.handleDetailsOnHoverAction(action)) {
return
} else if (this.handleCollapseSubSeriesAction(action)) {
return
}
Expand Down Expand Up @@ -597,6 +631,9 @@ export default {
updateShowSubtitles() {
this.saveSettings()
},
updateShowDetailsOnHover() {
this.saveSettings()
},
updateAuthorSort() {
this.saveSettings()
},
Expand Down
Loading
Loading