Avoid racing TinyMCE, which avoids the creation of unnecessary autosaves. props azaozz. see #7392.
git-svn-id: http://core.svn.wordpress.org/trunk@24849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5c20d1eca1
commit
23bc457498
|
@ -2,22 +2,11 @@ var autosave, autosaveLast = '', autosavePeriodical, autosaveDelayPreview = fals
|
||||||
|
|
||||||
jQuery(document).ready( function($) {
|
jQuery(document).ready( function($) {
|
||||||
|
|
||||||
if ( $('#wp-content-wrap').hasClass('tmce-active') && typeof tinymce != 'undefined' ) {
|
if ( $('#wp-content-wrap').hasClass('tmce-active') && typeof switchEditors != 'undefined' ) {
|
||||||
tinymce.onAddEditor.add( function( tinymce, editor ) {
|
autosaveLast = wp.autosave.getCompareString({
|
||||||
if ( 'content' == editor.id ) {
|
post_title : $('#title').val() || '',
|
||||||
editor.onLoad.add( function() {
|
content : switchEditors.pre_wpautop( $('#content').val() ) || '',
|
||||||
editor.save();
|
excerpt : $('#excerpt').val() || ''
|
||||||
if ( typeof switchEditors != 'undefined' ) {
|
|
||||||
autosaveLast = wp.autosave.getCompareString({
|
|
||||||
post_title : $('#title').val() || '',
|
|
||||||
content : switchEditors.pre_wpautop( $('#content').val() ) || '',
|
|
||||||
excerpt : $('#excerpt').val() || '',
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
autosaveLast = wp.autosave.getCompareString();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
autosaveLast = wp.autosave.getCompareString();
|
autosaveLast = wp.autosave.getCompareString();
|
||||||
|
|
Loading…
Reference in New Issue