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

Major RTL fixes #961

Merged
merged 1 commit into from May 15, 2020
Merged

Major RTL fixes #961

merged 1 commit into from May 15, 2020

Conversation

alidbc
Copy link
Contributor

@alidbc alidbc commented Jul 13, 2019

Various fixes for RTL handling

these changes also fixed issue #729: v0.3 RTL paging doesn't work correctly in Firefox and mobile Safari

Detailed changes:

Content.js

Added direction parameter to columns function to determine direction based on overall direction of the book not depending on random rtl direction attribute attached to the body

Layout.js

Pass the direction parameter to content.columns function from the the format function

managers/continuous/index.js

handle rtf scrolling on erase function, this resolves jumping to next chapter in rtl instead of showing the remaining content.

managers/default/index.js

added code to detect RTL scroll type as firefox use negative scrolling, chrome use positive

fixes to both next and prev functions in rtl paging
fixed firefox jump to next chapter instead of turning to next page

packaging.js

added language check against rtl languages for better handling of book direction instead of counting only on the spine attributes “page-progression-direction”

@fchasen
Copy link
Contributor

fchasen commented Jul 18, 2019

Thanks so much for this PR, I'll review it early next week!

@bperel
Copy link

bperel commented Jan 22, 2020

@fchasen This seems to fix some issues in our project for RTL books on Firefox. Would you have time to have a look at it?

@fchasen
Copy link
Contributor

fchasen commented Jan 22, 2020

Yes sorry again about the pause, will get this merged very soon.

@bperel
Copy link

bperel commented Feb 3, 2020

Hi @fchasen , did you have the time to make some progress on this ticket?

@fchasen
Copy link
Contributor

fchasen commented May 15, 2020

For my reference, the detection code is similar to https://github.com/othree/jquery.rtl-scroll-type

This is needed as per ☝️

Horizontal scrollbar with RTL(right to left) language support has different implementations in different browsers.

scrollLeft in RTL element is not defined by any spec or standards. So different browsers have different implementations. As far as I know, there are three implements: Chrome(Blink), Firefox/Safari, IE.

Chrome's RTL scrollbar is the same as LTR(left to right) element. Except for the initial position of the scrollbar controller is at the most right position.

Firefox has a clear definition in its MDN document. The most right position stands for 0. And when the user scrolls to the left. The value decreases. The value is possible to be negative in this implement.

In that library there is a request by a member of the Chromium team to update the detection code to not trigger their their counter, which I'll bring into our detection after merging. othree/jquery.rtl-scroll-type#6

Thanks again for these updates, sorry it took so long for me to get on board with what was happening!

@fchasen fchasen merged commit 5081589 into futurepress:master May 15, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants