WordPress.org

Make WordPress Core

Ticket #6682: autosave-on-preview.patch

File autosave-on-preview.patch, 758 bytes (added by DanCoulter, 10 years ago)
  • wp-includes/js/autosave.js

     
    88
    99        //Disable autosave after the form has been submitted
    1010        $("#post").submit(function() { $.cancel(autosavePeriodical); });
     11       
     12        // Autosave when the preview button is clicked.
     13        $('#previewview a').click(autosave);
    1114});
    1215
    1316// called when autosaving pre-existing post
     
    8992                        getpermalinknonce: jQuery('#getpermalinknonce').val()
    9093                }, function(permalink) {
    9194                        jQuery('#previewview').html('<a target="_blank" href="'+permalink+'" tabindex="4">'+previewText+'</a>');
     95                        jQuery('#previewview a').click(autosave);
    9296                });
    9397        }
    9498}