mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-02 14:49:16 +02:00
Pass mark events from the rendition
This commit is contained in:
parent
1eb2566b15
commit
ee2264b064
3 changed files with 18 additions and 3 deletions
|
@ -555,6 +555,7 @@ class Rendition {
|
|||
});
|
||||
|
||||
contents.on("selected", (e) => this.triggerSelectedEvent(e, contents));
|
||||
contents.on("markClicked", (cfiRange, data) => this.triggerMarkEvent(cfiRange, data, contents));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -575,6 +576,15 @@ class Rendition {
|
|||
this.emit("selected", cfirange, contents);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit a markClicked event with the cfiRange and data from a mark
|
||||
* @private
|
||||
* @param {EpubCFI} cfirange
|
||||
*/
|
||||
triggerMarkEvent(cfiRange, data, contents){
|
||||
this.emit("markClicked", cfiRange, data, contents);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Range from a Visible CFI
|
||||
* @param {string} cfi EpubCfi String
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue