diff options
Diffstat (limited to 'epubview/widgets.py')
-rw-r--r-- | epubview/widgets.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/epubview/widgets.py b/epubview/widgets.py index d80c45a..0458573 100644 --- a/epubview/widgets.py +++ b/epubview/widgets.py @@ -5,12 +5,12 @@ import gtk class _WebView(webkit.WebView): def __init__(self): webkit.WebView.__init__(self) - + def get_page_height(self): ''' Gets height (in pixels) of loaded (X)HTML page. This is done via javascript at the moment - ''' + ''' #TODO: Need to check status of page load js = 'oldtitle=document.title;document.title=Math.max(document.body.scrollHeight, document.body.offsetHeight,document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);' self.execute_script(js) @@ -20,12 +20,12 @@ class _WebView(webkit.WebView): if ret is None: return 0 return int(ret) - + def add_bottom_padding(self, incr): ''' Adds incr pixels of padding to the end of the loaded (X)HTML page. This is done via javascript at the moment - ''' + ''' js = ('var newdiv = document.createElement("div");newdiv.style.height = "%dpx";document.body.appendChild(newdiv);' % incr) self.execute_script(js) - + |