Make WordPress Core

Changeset 24691


Ignore:
Timestamp:
07/12/2013 09:07:44 PM (13 years ago)
Author:
nacin
Message:

For an intermittent connection, only disable save and publish buttons when the request times out. An error still means a we have a connection.

props azaozz.
see #24695.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/autosave.js

    r24431 r24691  
    143143
    144144        // When connection is lost, keep user from submitting changes.
    145         $(document).on('heartbeat-connection-lost.autosave', function() {
    146                 autosave_disable_buttons();
    147                 $('#lost-connection-notice').show();
     145        $(document).on('heartbeat-connection-lost.autosave', function( e, error ) {
     146                if ( 'timeout' === error ) {
     147                        $('#lost-connection-notice').show();
     148                        autosave_disable_buttons();
     149                }
    148150        }).on('heartbeat-connection-restored.autosave', function() {
     151                $('#lost-connection-notice').hide();
    149152                autosave_enable_buttons();
    150                 $('#lost-connection-notice').hide();
    151153        });
    152154});
Note: See TracChangeset for help on using the changeset viewer.