Make WordPress Core

Ticket #31964: unload-function-replaceable3.patch

File unload-function-replaceable3.patch, 620 bytes (added by adamsilverstein, 9 years ago)

whitespace fix

  • updates.js

    old new  
    538538         * If an update is on-going and a user attempts to leave the page,
    539539         * open an "Are you sure?" alert.
    540540         */
    541         $( window ).on( 'beforeunload', function() {
     541        wp.updates.beforeunload = function() {
    542542                if ( wp.updates.updateLock ) {
    543543                        return wp.updates.l10n.beforeunload;
    544544                }
    545         });
     545        }
     546
     547        $( window ).on( 'beforeunload', function() { wp.updates.beforeunload(); } );
     548
     549        $( document ).trigger( 'wp-plugin-shinyupdates-loaded' );
    546550
    547551})( jQuery, window.wp, window.pagenow, window.ajaxurl );