mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Apparently layoutStyle() is deprecated
This commit is contained in:
parent
83dd9c375d
commit
be146674de
@ -45,6 +45,10 @@ CALIBRE_VERSION = '__CALIBRE_VERSION__'
|
|||||||
ERS_SUPPORTED_FEATURES = {'dom-manipulation', 'layout-changes', 'touch-events', 'mouse-events', 'keyboard-events', 'spine-scripting'}
|
ERS_SUPPORTED_FEATURES = {'dom-manipulation', 'layout-changes', 'touch-events', 'mouse-events', 'keyboard-events', 'spine-scripting'}
|
||||||
|
|
||||||
|
|
||||||
|
def layout_style():
|
||||||
|
return 'scrolling' if current_layout_mode() is 'flow' else 'paginated'
|
||||||
|
|
||||||
|
|
||||||
class EPUBReadingSystem:
|
class EPUBReadingSystem:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -57,7 +61,7 @@ class EPUBReadingSystem:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def layoutStyle(self):
|
def layoutStyle(self):
|
||||||
return 'scrolling' if current_layout_mode() is 'flow' else 'paginated'
|
return layout_style()
|
||||||
|
|
||||||
def hasFeature(self, feature, version):
|
def hasFeature(self, feature, version):
|
||||||
return feature in ERS_SUPPORTED_FEATURES
|
return feature in ERS_SUPPORTED_FEATURES
|
||||||
@ -251,7 +255,7 @@ class IframeBoss:
|
|||||||
document.documentElement.style.overflow = 'hidden'
|
document.documentElement.style.overflow = 'hidden'
|
||||||
if self.is_titlepage and not opts.cover_preserve_aspect_ratio:
|
if self.is_titlepage and not opts.cover_preserve_aspect_ratio:
|
||||||
document.body.classList.add('cover-fill')
|
document.body.classList.add('cover-fill')
|
||||||
document.body.classList.add(f'calibre-viewer-{window.navigator.epubReadingSystem.layoutStyle}')
|
document.body.classList.add(f'calibre-viewer-{layout_style()}')
|
||||||
self.last_window_width, self.last_window_height = scroll_viewport.width(), scroll_viewport.height()
|
self.last_window_width, self.last_window_height = scroll_viewport.width(), scroll_viewport.height()
|
||||||
apply_settings()
|
apply_settings()
|
||||||
self.fix_fullscreen_svg_images()
|
self.fix_fullscreen_svg_images()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user