Ticket #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) |
| Keywords: | Cc: |
Description
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 ) ;
}
}
Change History
Note: See
TracTickets for help on using
tickets.