WordPress.org

Make WordPress Core

Changeset 7812


Ignore:
Timestamp:
04/25/08 00:32:16 (6 years ago)
Author:
ryan
Message:

Bump the autosave re-enable delay to 5 seconds, makes sure we manually re-enable the buttons on ajax success, and visually dim the disabled buttons for some UI feedback. Props mdawaffe. fixes #6707 for 2.5

Location:
branches/2.5
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/wp-admin/css/colors-classic.css

    r7518 r7812  
    191191    color: #07273e; 
    192192    border-color: #a3a3a3; 
     193} 
     194 
     195.button[disabled], .button:disabled { 
     196    background-color: #999; 
    193197} 
    194198 
  • branches/2.5/wp-admin/css/colors-fresh.css

    r7538 r7812  
    187187    color: #246; 
    188188    border-color: #80b5d0; 
     189} 
     190 
     191.button[disabled], .button:disabled { 
     192    background-color: #999; 
    189193} 
    190194 
  • branches/2.5/wp-includes/js/autosave.js

    r7791 r7812  
    5757        var tempID = jQuery('#post_ID').val(); 
    5858        var postID = parseInt( res.responses[0].id ); 
    59         autosave_update_post_ID( postID ); 
     59        autosave_update_post_ID( postID ); // disabled form buttons are re-enabled here 
    6060        if ( tempID < 0 && postID > 0) // update media buttons 
    6161            jQuery('#media-buttons a').each(function(){ 
    6262                this.href = this.href.replace(tempID, postID); 
    6363            }); 
    64     } 
    65     autosave_enable_buttons(); // re-enable disabled form buttons 
     64    } else { 
     65        autosave_enable_buttons(); // re-enable disabled form buttons 
     66    } 
    6667} 
    6768 
     
    7980        }, function(html) { 
    8081            jQuery('#_wpnonce').val(html); 
     82            autosave_enable_buttons(); // re-enable disabled form buttons 
    8183        }); 
    8284        jQuery('#hiddenaction').val('editpost'); 
     
    128130function autosave_disable_buttons() { 
    129131    jQuery("#submitpost :button:enabled, #submitpost :submit:enabled").attr('disabled', 'disabled'); 
    130     setTimeout(autosave_enable_buttons, 1000); // Re-enable 1 sec later.  Just gives autosave a head start to avoid collisions. 
     132    setTimeout(autosave_enable_buttons, 5000); // Re-enable 5 sec later.  Just gives autosave a head start to avoid collisions. 
    131133} 
    132134 
  • branches/2.5/wp-includes/script-loader.php

    r7789 r7812  
    4848        ) ); 
    4949 
    50         $this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080422' ); 
     50        $this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080424' ); 
    5151 
    5252        $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306'); 
Note: See TracChangeset for help on using the changeset viewer.