[wp-trac] [WordPress Trac] #31819: Shiny updates: more sophisticated locking

WordPress Trac noreply at wordpress.org
Sat Apr 11 13:56:38 UTC 2015


#31819: Shiny updates: more sophisticated locking
-------------------------------------+-------------------------------------
 Reporter:  DavidAnderson            |       Owner:  jorbin
     Type:  enhancement              |      Status:  reopened
 Priority:  normal                   |   Milestone:  4.2
Component:  Upgrade/Install          |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  shiny-updates has-patch  |     Focuses:  ui, javascript,
  close                              |  administration
-------------------------------------+-------------------------------------
Changes (by DavidAnderson):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Re-opening - in case the comments aren't getting seen whilst the ticket is
 in the 'closed' state. (Sorry if this is the wrong thing to do - I wanted
 to make sure they're not missed).

 Regarding the queue locking and the unwanted "are you sure you want to
 leave?" message... a straightforward solution for this would be to not use
 an anonymous function.

 i.e. Instead of...

 {{{
 $( window ).on( 'beforeunload', function() {
         if ( wp.updates.updateLock ) {
                 return wp.updates.l10n.beforeunload;
         }
 });
 }}}

 ... use:


 {{{
 wp.updates.beforeunload = function() {
         if ( wp.updates.updateLock ) {
                 return wp.updates.l10n.beforeunload;
         }
 }

 $( window ).on( 'beforeunload', wp.updates.beforeunload);
 }}}

 Then, I can replace the function with my own that can tweak the logic
 appropriately for my use case.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31819#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list