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

adapt_framework: incorrect device classes with adapt-contrib-languagePicker #3116

Closed
danielghost opened this issue Apr 7, 2021 · 0 comments · Fixed by #3120
Closed

adapt_framework: incorrect device classes with adapt-contrib-languagePicker #3116

danielghost opened this issue Apr 7, 2021 · 0 comments · Fixed by #3120
Labels

Comments

@danielghost
Copy link
Contributor

Subject of the issue/enhancement/features

If using https://github.com/adaptlearning/adapt-contrib-languagePicker, it is possible for the size and orientation classes to be incorrect on the html tag once the course has fully loaded/initialized.

Your environment

  • adapt_framework 5.12.1, but not specific to this version

Steps to reproduce

  • Ensure adapt-contrib-languagePicker is installed and enabled, with "_showOnCourseLoad": true
  • Before selecting a language, resize the browser enough to enter a different breakpoint, i.e. large to small, portrait to landscape
  • Pick a language and then inspect the html classes which will still be set to the original values when the course loaded

Expected behaviour

https://github.com/adaptlearning/adapt_framework/blob/master/src/core/js/device.js doesn't listen to resize orientationchange events until Adapt#app:dataReady, which occurs after the languagePicker, so any changes made before a language selection are redundant and not reflected in the html classes once the data is ready.

Proposed change

The most obvious solution would be to change https://github.com/adaptlearning/adapt_framework/blob/master/src/core/js/device.js#L19 to listen to configModel:dataLoaded or offlineStorage:ready.

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

Successfully merging a pull request may close this issue.

1 participant