mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IE viewpoert scroll position fix
This commit is contained in:
parent
dfe9d4ff16
commit
61b8399e44
@ -68,8 +68,16 @@ get_current_time = (target) -> # {{{
|
||||
|
||||
viewport_to_document = (x, y, doc) -> # {{{
|
||||
win = doc.defaultView
|
||||
x += if win.scrollX then win.scrollX else 0 # These can be NaN on IE
|
||||
y += if win.scrollY then win.scrollY else 0
|
||||
if typeof(win.pageXOffset) == 'number'
|
||||
x += win.pageXOffset
|
||||
y += win.pageYOffset
|
||||
else # IE < 9
|
||||
if document.body and ( document.body.scrollLeft or document.body.scrollTop )
|
||||
x += document.body.scrollLeft
|
||||
y += document.body.scrollTop
|
||||
else if document.documentElement and ( document.documentElement.scrollLeft or document.documentElement.scrollTop)
|
||||
y += document.documentElement.scrollTop
|
||||
x += document.documentElement.scrollLeft
|
||||
|
||||
if doc != window.document
|
||||
# We are in a frame
|
||||
|
@ -2,6 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Testing CFI functionality</title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="http://calibre-ebook.com/favicon.ico" />
|
||||
<script type="text/javascript" src="cfi.coffee"></script>
|
||||
<script type="text/javascript" src="cfi-test.coffee"></script>
|
||||
<style type="text/css">
|
||||
@ -73,7 +74,7 @@
|
||||
<p>An invisible Comment: <!-- aaaaaa --> followed by some text</p>
|
||||
<p>An invalid (in HTML) CDATA: <![CDATA[CDATA]]> followed by some text</p>
|
||||
<h2>Margins padding borders</h2>
|
||||
<p>Try clicking in the margins, borders and padding</p>
|
||||
<p>Try clicking in the margins, borders and padding. There should be no effect.</p>
|
||||
|
||||
<p id="whitespace">But I must explain to you how all this mistaken
|
||||
idea of denouncing pleasure and praising pain was born and I
|
||||
@ -96,6 +97,11 @@
|
||||
demoralized by the charms of pleasure of the moment, so blinded
|
||||
by desire, that they cannot foresee</p>
|
||||
|
||||
<h2>Lots of nested tags</h2>
|
||||
<p>A <span>bunch of <span>nested<span> and</span> <span>sibling</span>
|
||||
tags, all </span> mixed together</span>. <span>Click all</span>
|
||||
over this paragraph to test<span> things.</span></p>
|
||||
|
||||
</div>
|
||||
<img id="marker" style="position: absolute; display:none; z-index:10" src="marker.png" alt="Marker" />
|
||||
</body>
|
||||
|
Loading…
x
Reference in New Issue
Block a user