wepub

Check-in [903e492aa3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Return to previous position
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:903e492aa3b69ab9d3342a64301f7e68212fe8cac7904e671a87bf5296eeacaf
User & Date: ajv-899-334-8894@vsta.org 2016-11-17 17:30:18
Context
2016-11-17
17:33
Convert to account server check-in: db7a51a379 user: ajv-899-334-8894@vsta.org tags: master, trunk
17:30
Return to previous position check-in: 903e492aa3 user: ajv-899-334-8894@vsta.org tags: master, trunk
17:29
Correctly dequote path names. Make text readable. check-in: 7efc426083 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to js/reader.js.

78
79
80
81
82
83
84






85
86
87
88
89
90
91
92
93
94
95

96
97
98
//  text content of this document.  If there's a saved position,
//  scroll to it.
function reading(arg_who, arg_doc, arg_pane) {
    // Save for future
    who = arg_who;
    docname = arg_doc;
    pane = document.getElementById(arg_pane);







    // Snapshot our reading position when we switch away
    document.addEventListener("blur", save_state);
    document.addEventListener("mouseleave", save_state);
    document.addEventListener("visibilitychange", function () {
        if (document.hidden) {
            save_state();
        }
    });

    // Get any saved state

    xhr_get("/state.json?doc=" + encodeURIComponent(docname),
        start_state);
}







>
>
>
>
>
>










|
>



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//  text content of this document.  If there's a saved position,
//  scroll to it.
function reading(arg_who, arg_doc, arg_pane) {
    // Save for future
    who = arg_who;
    docname = arg_doc;
    pane = document.getElementById(arg_pane);

    // By default, start at top of document
    var d = document.scrollingElement;
    if (d != null) {
        d.scrollTop = 0;
    }

    // Snapshot our reading position when we switch away
    document.addEventListener("blur", save_state);
    document.addEventListener("mouseleave", save_state);
    document.addEventListener("visibilitychange", function () {
        if (document.hidden) {
            save_state();
        }
    });

    // Get any saved state.  This will scroll us to our last
    //  saved reading position.
    xhr_get("/state.json?doc=" + encodeURIComponent(docname),
        start_state);
}