mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Rename rendition.range -> rendition.getRange
This commit is contained in:
parent
bf9cd9f279
commit
f0856ea78c
2 changed files with 3 additions and 3 deletions
|
@ -193,7 +193,7 @@
|
||||||
// Apply a class to selected text
|
// Apply a class to selected text
|
||||||
rendition.on("selected", function(cfiRange) {
|
rendition.on("selected", function(cfiRange) {
|
||||||
// Get the dom range of the selected text
|
// Get the dom range of the selected text
|
||||||
var range = rendition.range(cfiRange);
|
var range = rendition.getRange(cfiRange);
|
||||||
// Create an empty Rangy range
|
// Create an empty Rangy range
|
||||||
var rr = rangy.createRange();
|
var rr = rangy.createRange();
|
||||||
// Set that range to equal the dom range
|
// Set that range to equal the dom range
|
||||||
|
|
|
@ -581,7 +581,7 @@ class Rendition {
|
||||||
* @param {string} ignoreClass
|
* @param {string} ignoreClass
|
||||||
* @return {range}
|
* @return {range}
|
||||||
*/
|
*/
|
||||||
range(cfi, ignoreClass){
|
getRange(cfi, ignoreClass){
|
||||||
var _cfi = new EpubCFI(cfi);
|
var _cfi = new EpubCFI(cfi);
|
||||||
var found = this.manager.visible().filter(function (view) {
|
var found = this.manager.visible().filter(function (view) {
|
||||||
if(_cfi.spinePos === view.index) return true;
|
if(_cfi.spinePos === view.index) return true;
|
||||||
|
@ -589,7 +589,7 @@ class Rendition {
|
||||||
|
|
||||||
// Should only every return 1 item
|
// Should only every return 1 item
|
||||||
if (found.length) {
|
if (found.length) {
|
||||||
return found[0].range(_cfi, ignoreClass);
|
return found[0].contents.range(_cfi, ignoreClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue