﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1482	IsDirty always true after loading content with anchors	Rowen		"On calling SetHTML/SetData with content containing an anchor, the isdirty flag is true even when resetDirtyFlag is passed as true. The reason appears to be that the onSetHTML event fires after the dirty flag is reset, which in turn calls process and processes the targets adding the 'FCK__AnchorC' cssclass.

1: call setHTML (now appears to be setData) with sample content containing an anchor (e.g. <p>L<a href=""#Fred"">in</a>k2</p><p>P<a name=""Fred"">Fred</a></p>and resetIsDirty = true.
2: check to see if the fck editor isDirty flag is false.

A suggested solution is to modify the function '_FCK_EditingArea_OnLoad', and move the 'ResetIsDirty()' call to after the 'OnAfterSetHTML()' call.


function _FCK_EditingArea_OnLoad()
{
	// Get the editor's window and document (DOM)
	FCK.EditorWindow	= FCK.EditingArea.Window ;
	FCK.EditorDocument	= FCK.EditingArea.Document ;

	FCK.InitializeBehaviors() ;

	// Create the enter key handler
	if ( !FCKConfig.DisableEnterKeyHandler )
		FCK.EnterKeyHandler = new FCKEnterKey( FCK.EditorWindow, FCKConfig.EnterMode, FCKConfig.ShiftEnterMode ) ;

	// Listen for keystroke events.
	FCK.KeystrokeHandler.AttachToElement( FCK.EditorDocument ) ;



	// This is a tricky thing for IE. In some cases, even if the cursor is
	// blinking in the editing, the keystroke handler doesn't catch keyboard
	// events. We must activate the editing area to make it work. (#142).
	if ( FCKBrowserInfo.IsIE && FCK.HasFocus )
		FCK.EditorDocument.body.setActive() ;

	FCK.OnAfterSetHTML() ;

        // moved to after OnAfterSetHTML so that anchor processing does not dirty content

	if ( FCK._ForceResetIsDirty )
		FCK.ResetIsDirty() ;

	// Check if it is not a startup call, otherwise complete the startup.
	if ( FCK.Status != FCK_STATUS_NOTLOADED )
		return ;

	FCK.SetStatus( FCK_STATUS_ACTIVE ) ;
}"	Bug	closed	Normal		General	FCKeditor 2.4.3	wontfix		
