﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1500	The _FCK_PaddingNodeListener is called multiple times	Alfonso Martínez de Lizarrondo	Alfonso Martínez de Lizarrondo	"Load the editor and press New Page several times (well, don't do it in IE or it will crash, #1498)

The OnSelectionChange event will have several calls to _FCK_PaddingNodeListener, and in Gecko also to FCK._ExecCheckEmptyBlock

I've modified slightly the FCKEvents.prototype.AttachEvent so it tries to detect if the functionPointer is already registered, but in Gecko it doesn't detect the duplication of FCK._ExecCheckEmptyBlock, so anyway the full fix (making sure that the  AttachEvent is called only on startup is needed.

{{{

FCKEvents.prototype.AttachEvent = function( eventName, functionPointer )
{
	var aTargets ;

	if ( !( aTargets = this._RegisteredEvents[ eventName ] ) )
		this._RegisteredEvents[ eventName ] = [ functionPointer ] ;
	else
	{
		// Check that the event handler isn't already registered with the same listener
		// It doesn't detect function pointers belonging to an object (at least in Gecko)
		if ( aTargets.IndexOf( functionPointer ) == -1 )
			aTargets.push( functionPointer ) ;
	}
}
}}}
"	Bug	closed	Normal	FCKeditor 2.5	General	SVN (FCKeditor) - Retired	fixed		
