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

⚡️(iframe) precalculate iframe height to improve user visual feeling #27

Merged
merged 1 commit into from
Feb 13, 2019

Conversation

rmoch
Copy link
Contributor

@rmoch rmoch commented Feb 6, 2019

As iframeResizer may take a few seconds to initialize and set correct iframe
height, we calculate probable height regarding available width and configuration
given ratio. We also use more comprehensive settings and drop deprecated
XBlock.fragment library in favor of web_fragment.fragment

@rmoch rmoch changed the title WIP ⚡️(iframe) precalculate iframe height to improve user visual feeling ⚡️(iframe) precalculate iframe height to improve user visual feeling Feb 7, 2019
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
configurable_lti_consumer/configurable_lti_consumer.py Outdated Show resolved Hide resolved
configurable_lti_consumer/templates/html/student.html Outdated Show resolved Hide resolved
@rmoch rmoch force-pushed the anticipate-iframe-height branch 3 times, most recently from 0b675d5 to dfb85b1 Compare February 8, 2019 09:05
@sampaccoud
Copy link

sampaccoud commented Feb 12, 2019

@rmoch I proposed a fixup to really de-correlate the ratio from the iframe resizer.
Setting the inline_ratio can make sense even for LTI services that don't have iFrame resizer because it allows you to set a fix ratio for your window that will look nice on any screen.

I tested it in all the following cases and it seems to work (would have written tests if there had been a test workbench. Let's do it in a separate PR 😃):

  • iFrame resizer is on
    • inline_ratio is set > XBlock opens with the specified ratio and resizes once the iFrame is loaded
    • inline_ratio is not set > XBlock opens with the specified inline_height and resizes once the iFrame is loaded
  • iFrame resizer is off
    • inline_ratio is set > XBlock opens with the specified ratio and remains
    • inline_ratio is not set > XBlock opens with the specified inline_height and remains

WDYT?

@sampaccoud sampaccoud force-pushed the anticipate-iframe-height branch 2 times, most recently from 248c6e0 to 06efe97 Compare February 13, 2019 10:37
As iframeResizer may take a few seconds to initialize and set correct iframe
height, we calculate probable height regarding available width and configuration
given ratio if available. We also use more comprehensive settings and drop
deprecated XBlock.fragment library in favor of web_fragment.fragment
@rmoch rmoch merged commit afa0f58 into master Feb 13, 2019
@jmaupetit jmaupetit deleted the anticipate-iframe-height branch February 13, 2019 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants