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

Do not process resize event if fotorama is hidden #470

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

doochik
Copy link

@doochik doochik commented Mar 30, 2016

Resize event recalcs image dimensions in wrong way (see example https://jsfiddle.net/doochik/1mdhtbav/).
In this case we should stop processing resize event if fotorama is hidden.
As a workaround for this bug we can use position:abosulte;left:-9990px;top:-9999px instead of display: none to hide fotorama.

@@ -1231,6 +1231,9 @@ jQuery.Fotorama = function ($fotorama, opts) {
that.resize = function (options) {
if (!data) return this;

// don't process resize for hidden elements
if ($wrap.is(':hidden')) return this;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of "if".
It can be added here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i've fixed it

Resize event recalcs image dimensions in wrong way (see example https://jsfiddle.net/doochik/1mdhtbav/).
In this case we should stop processing resize event if fotorama is hidden.
As a workaround for this bug we can use `position:abosulte;left:-9990px;top:-9999px` instead of `display: none` to hide fotorama.
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.

1 participant