Skip to content

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

Description

@nsanthakumar86

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions