Opened 9 years ago

Closed 9 years ago

#1500 closed Bug (fixed)

The _FCK_PaddingNodeListener is called multiple times

Reported by: alfonsoml Owned by: alfonsoml
Priority: Normal Milestone: FCKeditor 2.5
Component: General Version: SVN (FCKeditor) - Retired
Keywords: Cc:


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 ] ;
		// 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 ) ;

Change History (1)

comment:1 Changed 9 years ago by alfonsoml

  • Milestone set to FCKeditor 2.5
  • Resolution set to fixed
  • Status changed from new to closed

Fixed with [1066]

The ideal solution would be to make the change to AttachEvent, so any other situation like this is automatically handled. Also it would allow to create a RemoveEvent function for the API.

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy