~ubuntu-branches/debian/sid/calibre/sid

« back to all changes in this revision

Viewing changes to src/calibre/ebooks/oeb/polish/choose.coffee

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-02-27 07:48:06 UTC
  • mto: This revision was merged to the branch mainline in revision 74.
  • Revision ID: package-import@ubuntu.com-20140227074806-64wdebb3ptosxhhx
Tags: upstream-1.25.0+dfsg
ImportĀ upstreamĀ versionĀ 1.25.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        # block, if any.
33
33
        event.stopPropagation()
34
34
        frac = window.pageYOffset/document.body.scrollHeight
35
 
        window.py_bridge.onclick(this, frac)
 
35
        loc = []
 
36
        totals = []
 
37
        parent = this
 
38
        while parent and parent.tagName.toLowerCase() != 'body'
 
39
            totals.push(parent.parentNode.children.length)
 
40
            num = 0
 
41
            sibling = parent.previousElementSibling
 
42
            while sibling
 
43
                num += 1
 
44
                sibling = sibling.previousElementSibling
 
45
            loc.push(num)
 
46
            parent = parent.parentNode
 
47
        loc.reverse()
 
48
        totals.reverse()
 
49
 
 
50
        window.py_bridge.onclick(this, JSON.stringify(loc), JSON.stringify(totals), frac)
36
51
        return false
37
52
 
38
53
calibre_anchor_locator = new AnchorLocator()