DFW: When hiding DFW, switch to correct main editors before saving content. Otherwise, some content will be lost. fixes #17729.

git-svn-id: https://develop.svn.wordpress.org/trunk@18203 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2011-06-08 20:55:33 +00:00
parent d2e01c2f1f
commit 2d56b5b9fd
3 changed files with 12 additions and 10 deletions

View File

@ -293,7 +293,7 @@ PubSub.prototype.publish = function( topic, args ) {
scrollTo(0, 0);
// needed it for IE7 and compat mode
$('#wpadminbar').hide();
$('#wpadminbar').hide();
});
ps.subscribe( 'shown', function() { // This event occurs after the DFW overlay is shown
@ -320,7 +320,16 @@ PubSub.prototype.publish = function( topic, args ) {
ps.subscribe( 'hide', function() { // This event occurs before the overlay blocks DFW.
// Make sure the correct editor is displaying.
if ( s.has_tinymce && s.mode === 'tinymce' && $('#' + s.editor_id).is(':visible') ) {
switchEditors.go( s.editor_id, 'tinymce' );
} else if ( s.mode === 'html' && $('#' + s.editor_id).is(':hidden') ) {
switchEditors.go( s.editor_id, 'html' );
}
// Save content must be after switchEditors or content will be overwritten. See #17229.
api.savecontent();
$( document ).unbind( '.fullscreen' );
$(s.textarea_obj).unbind('.grow');
@ -336,13 +345,6 @@ PubSub.prototype.publish = function( topic, args ) {
ps.subscribe( 'hiding', function() { // This event occurs while the overlay blocks the DFW UI.
// Make sure the correct editor is displaying.
if ( s.has_tinymce && s.mode === 'tinymce' && $('#' + s.editor_id).is(':visible') ) {
switchEditors.go( s.editor_id, 'tinymce' );
} else if ( s.mode == 'html' && $('#' + s.editor_id).is(':hidden') ) {
switchEditors.go( s.editor_id, 'html' );
}
$( document.body ).removeClass( 'fullscreen-active' );
scrollTo(0, s.orig_y);
$('#wpadminbar').show();

File diff suppressed because one or more lines are too long

View File

@ -96,7 +96,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), '20110411' );
$scripts->add_data( 'editor', 'group', 1 );
$scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), '20110603' );
$scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), '20110608' );
$scripts->add_data( 'wp-fullscreen', 'group', 1 );
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6.1');