You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
Attempt to open the popup - for example, from the console with $( "#thePopup" ).popup( "open" );
At this point, the popup fails to appear on the screen. The reason:
The popup attaches to "beforenavigate", and completes its opening sequence in response to the event.
Unfortunately, when build without init, the library does not call _registerInternalEvents(), which would cause a "navigate" binding to be added which, in turn, would cause the navigate special event's setup function to be called.
Popup uses "beforenavigate" before it attaches to navigate. "beforenavigate" is emitted by the navigate event code in addition to the navigate event. However, since it first attaches to "beforenavigate" and only then to "navigate", it never attaches to "navigate", meaning that, unless init runs as part of library load, the "navigate" event will not be initialized, and thus the popup will never receive the "beforenavigate" event it needs to complete the opening sequence.
Possible solutions:
Popup depends on init. This is bad because there's no reason for this, other than to have init run _registerInternalEvents, which attaches a permanent navigate handler, causing the event to become initialized.
$.mobile.document.one( "navigate", $.noop ); before attaching to beforenavigate. This is not an elegant solution.
Initialize the "navigate" event even if somebody attaches to "beforenavigate" and not "navigate". I'm not sure how to accomplish this.
The text was updated successfully, but these errors were encountered:
You could define jQuery.event.special.beforenavigate with setup/teardown functions so that you only do the attaching to navigate if beforenavigate is used. Does that help?
It fails to close because it hooks up to the body to receive nav events, however, nav events are fired on the window. When there is no page life cycle handler, pagebeforechange events are not fired on the body, so the popup does not react at all. Solution? Forget about this.options.container, and listen on the window. Let's see if this has any negative consequences ...
@dmethvin
I think I'm going to define jQuery.event.special.beforenavigate with a setup that consists of $( window ).on( "navigate", someFunctionThatsANoopDeclaredInsideTheNavigateEventModulesIIFE );
Steps to reproduce:
At this point, the popup fails to appear on the screen. The reason:
The popup attaches to "beforenavigate", and completes its opening sequence in response to the event.
Unfortunately, when build without init, the library does not call _registerInternalEvents(), which would cause a "navigate" binding to be added which, in turn, would cause the navigate special event's setup function to be called.
Popup uses "beforenavigate" before it attaches to navigate. "beforenavigate" is emitted by the navigate event code in addition to the navigate event. However, since it first attaches to "beforenavigate" and only then to "navigate", it never attaches to "navigate", meaning that, unless init runs as part of library load, the "navigate" event will not be initialized, and thus the popup will never receive the "beforenavigate" event it needs to complete the opening sequence.
Possible solutions:
The text was updated successfully, but these errors were encountered: