[wp-trac] [WordPress Trac] #31769: Prevent navigating away while plugins are updating via shiny updates
WordPress Trac
noreply at wordpress.org
Sat Apr 4 20:40:47 UTC 2015
#31769: Prevent navigating away while plugins are updating via shiny updates
-------------------------------------+-------------------------------------
Reporter: johnbillion | Owner: johnbillion
Type: enhancement | Status: reviewing
Priority: normal | Milestone: 4.2
Component: Upgrade/Install | Version: trunk
Severity: normal | Resolution:
Keywords: dev-feedback needs- | Focuses: javascript,
testing has-patch | administration
-------------------------------------+-------------------------------------
Comment (by ericlewis):
In attachment:31769.4.diff,
* move the `beforeunload` handler to a callback bound via `$( window ).on(
'beforeunload' )`, rather than setting and unsetting the callback to
`window.onbeforeunload`. We don't need to play hot potato with the
callback because the internal conditional logic will decide whether to pop
open the "Are you sure?" alert.
* remove the `wp.ajax.post().always()` callback, which will cause spurious
requests when a user inputs the wrong credentials.
[https://core.trac.wordpress.org/ticket/31528#comment:18 See this
comment]. The lock is released in `wp.updates.updateSuccess()`, and the
request modal is re-opened in the error modal, so the lock doesn't need to
be released in `wp.updates.updateError()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31769#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list