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

Previous/next page arrow buttons are hidden, but associated commands are enabled (invokable by keyboard shortcuts and access keys) => problematic with non-linear spine items #188

Open
danielweck opened this issue Sep 1, 2014 · 7 comments

Comments

@danielweck
Copy link
Member

To reproduce:
(1) navigate to a non-linear spine item (via the TOC or an content-embedded hyperlink) => the left/right arrow buttons are correctly hidden.
(2) use the arrow keys to switch page => the non-linear XHTML document should be "trapped" as if it were represented in a modal dialog, but the page switches unexpectedly.

Suggested solutions:

(1) disable the actual page turn command, not just visually hide the buttons. Consequently though, the user would need to be able to navigate back to the previous document CFI location (i.e. which was displayed when the hyperlink to the non-linear document was activated). iBooks implements a proper modal dialog, with a "close" cross icon to discard the fullscreen popup overlay. In Readium however, another type of UI affordance needs to be introduced in order to achieve a similar effect. I'm not sure how, but accessibility is paramount, as non-linear documents are often used for ancillary content descriptions. Thoughts? (this would need to be implemented in v1, otherwise non-linear spine items would be like "trapping" blackholes!)

(2) enable both page arrow buttons when navigating to a non-linear document. This way, we revert back to the original behaviour and we decide to tackle the problem in v1+, see:
readium/readium-shared-js#26

I have a preference for (1), but I am not sure whether this development task is achievable within the v1 timeframe. @rkwright ?

@danielweck danielweck added this to the v1 milestone Sep 1, 2014
@rkwright
Copy link
Contributor

rkwright commented Sep 2, 2014

It's not needed for v1 so we won't do it. I am also in favor of 1, but want to spend a little time thinking/discussing it and we're out of time. But thanks for raising the issue.

@danielweck
Copy link
Member Author

@rkwright just to make sure I understand correctly: does this mean that we should now re-enable the left/right buttons when displaying a non-linear spine item document (i.e. option 2)?

@danielweck
Copy link
Member Author

Related issue (non-linear ancillary document has multiple pages, yet previous/next page buttons are always disabled):
readium/readium-shared-js#108
(API needs fixing)

@rkwright
Copy link
Contributor

rkwright commented Sep 2, 2014

Good catch. But this illustrates why I don't want to touch it this week. Let's get the GM out then do some serious thinking and documenting of all the wrinkles.

@danielweck
Copy link
Member Author

Fixed in PR: #402

@muyarkyawwin
Copy link

May I know how to disable the Previous and Next buttons in Readium using javascript?

@danielweck
Copy link
Member Author

@muyarkyawwin $("#ID").show() / $("#ID").hide() is the "naive" way of doing it, as described in this issue (the correct way is to implement command bindings, so that the state of the UI is refreshed based on the internal state of the navigation commands (e.g. disabled / enabled)).

See:
https://github.com/readium/readium-js-viewer/blob/develop/src/js/EpubReader.js#L752

    var updateUI = function(pageChangeData){
        if(pageChangeData.paginationInfo.canGoLeft())
            $("#left-page-btn").show();
        else
            $("#left-page-btn").hide();
        if(pageChangeData.paginationInfo.canGoRight())
            $("#right-page-btn").show();
        else
            $("#right-page-btn").hide();
    }

@rkwright rkwright removed this from the m1.1 milestone May 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants