Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node to percent calculation is not giving expected page no #264

Open
nsanthakumar86 opened this issue Mar 11, 2016 · 0 comments
Open

Node to percent calculation is not giving expected page no #264

nsanthakumar86 opened this issue Mar 11, 2016 · 0 comments

Comments

@nsanthakumar86
Copy link

I have tried to show epub book by monocle in android app. It has muliple xhtml file. I am facing problem while navigating to selected section by selector. The below function has been used for navigation.

function goToSelector(cmptId, selector) {
window.reader.moveTo({ componentId: cmptId, selector: selector });

  }

we are passing component id as file:///data/data/com.xxx.yyy/epubfolder/book1.xhtml
selector: #P009...;

In this flow, It is executing the querySelector() method by given selector(#P00044.....) in whole window and getting node( I printed this node innnerHTML in cosole, It is correct node of our selection id only).

And then it is passing this node to pageForSelector() method to get the page no and inside this method it is calculating percent of locus.

Now locus has component id and locus percent using by those values percentToPageNumber() method returning page no.

It is loading this page no only but its wrong in mobile.

But i have executed same xhtml file with locus-selection test app. In desktop it is working but not in app.

Please help me to resolve this issue.

Note: This Problem is happening only for page is too big. It means it divided as more than 5 sections.

Thanks,
Santhakumar.N

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant