[wp-trac] [WordPress Trac] #18279: Using Featured image: post state is set dirty, even when no changes to content
WordPress Trac
wp-trac at lists.automattic.com
Thu Jul 28 11:36:00 UTC 2011
#18279: Using Featured image: post state is set dirty, even when no changes to
content
-----------------------------+-----------------------------
Reporter: jacobcoens | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Post Thumbnails | Version: 3.2.1
Severity: normal | Keywords: has-patch
-----------------------------+-----------------------------
Browser: IE
Behavior:
When editing a post and clicking 'Set featured image', a (thickbox) popup
opens. When cancelling, the MCE state is dirty, even when no changes to
the content have been made.
This is causing the message 'Are you sure you want to navigate away from
this page?' to be displayed when navigating to another page.
Cause:
This happens in IE because a bookmark is created to store the caret
position.
Fix:
Remember the 'dirty' state of MCE, and re-apply it to the editor after
creating the bookmark.
In wp-admin/js/media-upload.dev.js, replace line 62-68 with below:
var ed;
if ( typeof tinyMCE != 'undefined' && tinymce.isIE
&& ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
var dirty = ed.isDirty();
ed.focus();
ed.windowManager.insertimagebookmark =
ed.selection.getBookmark();
ed.isNotDirty = !dirty;
}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18279>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list