mirror of
https://github.com/gotson/komga.git
synced 2026-05-07 12:01:40 +02:00
feat(webreader): add fullscreen keyboard shortcut
This commit is contained in:
parent
3fb24cba26
commit
a72a3bab62
3 changed files with 7 additions and 0 deletions
|
|
@ -17,6 +17,9 @@ export const shortcutsSettings = [
|
||||||
new Shortcut('bookreader.shortcuts.cycle_scale',
|
new Shortcut('bookreader.shortcuts.cycle_scale',
|
||||||
(ctx: any) => ctx.cycleScale()
|
(ctx: any) => ctx.cycleScale()
|
||||||
, 'c'),
|
, 'c'),
|
||||||
|
new Shortcut('bookreader.shortcuts.fullscreen',
|
||||||
|
(ctx: any) => ctx.switchFullscreen()
|
||||||
|
, 'f'),
|
||||||
]
|
]
|
||||||
|
|
||||||
export const shortcutsMenus = [
|
export const shortcutsMenus = [
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,7 @@
|
||||||
"cycle_scale": "Cycle scale",
|
"cycle_scale": "Cycle scale",
|
||||||
"cycle_side_padding": "Cycle side padding",
|
"cycle_side_padding": "Cycle side padding",
|
||||||
"first_page": "First page",
|
"first_page": "First page",
|
||||||
|
"fullscreen": "Enter/exit full screen",
|
||||||
"last_page": "Last page",
|
"last_page": "Last page",
|
||||||
"left_to_right": "Left to Right",
|
"left_to_right": "Left to Right",
|
||||||
"menus": "Menus",
|
"menus": "Menus",
|
||||||
|
|
|
||||||
|
|
@ -626,6 +626,9 @@ export default Vue.extend({
|
||||||
enterFullscreen() {
|
enterFullscreen() {
|
||||||
if (screenfull.isEnabled) screenfull.request(document.documentElement, {navigationUI: 'hide'})
|
if (screenfull.isEnabled) screenfull.request(document.documentElement, {navigationUI: 'hide'})
|
||||||
},
|
},
|
||||||
|
switchFullscreen() {
|
||||||
|
if (screenfull.isEnabled) screenfull.isFullscreen ? screenfull.exit() : this.enterFullscreen()
|
||||||
|
},
|
||||||
fullscreenChanged() {
|
fullscreenChanged() {
|
||||||
if (screenfull.isEnabled && screenfull.isFullscreen) this.fullscreenIcon = 'mdi-fullscreen-exit'
|
if (screenfull.isEnabled && screenfull.isFullscreen) this.fullscreenIcon = 'mdi-fullscreen-exit'
|
||||||
else this.fullscreenIcon = 'mdi-fullscreen'
|
else this.fullscreenIcon = 'mdi-fullscreen'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue