8000 Some codes uses jQuery without protection · Issue #74 · futurepress/epub.js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Some codes uses jQuery without protection #74
Closed
@shenzhuxi

Description

@shenzhuxi

For example pageturns.js need to be modified like this to work with other JS lib.

(function ($) {
  EPUBJS.Hooks.register("beforeChapterDisplay").pageTurns = function(callback, renderer){
        var lock = false;
        $(renderer.docEl).keydown(function(e){
            if(lock) return;
            if (e.keyCode == 37) {
                renderer.book.prevPage();
                lock = true;
                setTimeout(function(){
                    lock = false;
                }, 100);
                return false;
            }
            if (e.keyCode == 39) {
                renderer.book.nextPage();
                lock = true;
                setTimeout(function(){
                    lock = false;
                }, 100);
                return false;
            }
        });
        if(callback) callback();
  }
})(jQuery);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0