Skip to content

Fix for elements sometimes not reappearing after idle#392

Open
JakeQZ wants to merge 1 commit intoGalleriaJS:masterfrom
JakeQZ:idle-fix
Open

Fix for elements sometimes not reappearing after idle#392
JakeQZ wants to merge 1 commit intoGalleriaJS:masterfrom
JakeQZ:idle-fix

Conversation

@JakeQZ
Copy link
Copy Markdown

@JakeQZ JakeQZ commented Sep 1, 2017

Seen in Firefox 55.0.x. The animation completion callbacks are not
necessarily called in order, and occasionally the callback for elements
being shown occurs after the callback for them being hidden a few
seconds later. This probably isn't helped by every mousemove event
resulting in a fresh call to Utils.animate until the animation is
complete. The result is that the state logic indicates the elements are
shown when in fact they are not, so mousemove does not cause them to be
re-shown.

This change simplifies the logic so that idle.active and
data.complete are true when the elements are shown or being shown, and
false when the elements are hidden or being hidden, so an animation is
triggered only whenever the desired state is not current or already
becoming current. The animation callback and data.busy is now no
longer required.

Also ensured that data.complete is initially set correctly according
to whether the element is initially hidden, and corrected what appears
to be a typo in removeEvent (should remove the mousemove and click
events, not add them).

Seen in Firefox 55.0.x.  The animation completion callbacks are not
necessarily called in order, and occasionally the callback for elements
being shown occurs after the callback for them being hidden a few
seconds later.  This probably isn't helped by every mousemove event
resulting in a fresh call to Utils.animate until the animation is
complete.  The result is that the state logic indicates the elements are
shown when in fact they are not, so mousemove does not cause them to be
re-shown.

This change simplifies the logic so that `idle.active` and
`data.complete` are true when the elements are shown or being shown, and
false when the elements are hidden or being hidden, so an animation is
triggered only whenever the desired state is not current or already
becoming current.  The animation callback and `data.busy` is now no
longer required.

Also ensured that `data.complete` is initially set correctly according
to whether the element is initially hidden, and corrected what appears
to be a typo in removeEvent (should remove the mousemove and click
events, not add them).
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