Opened 9 years ago

Closed 9 years ago

#3173 closed New Feature (fixed)

Make it possible to register event listeners on instance creation

Reported by: Frederico Caldeira Knabben Owned by: Frederico Caldeira Knabben
Priority: Normal Milestone: CKEditor 3.0
Component: General Version:
Keywords: Confirmed Review+ Cc:

Description

The following currently doesn't work in all cases:

var editor = editor.replace( 'editor1' );
editor.on( 'someEvent', function() { ... } );

... because the event may be fired during the "replace" call, so the event registration comes too late.

There are ways to do so, but it's a little cumbersome:

CKEDITOR.on( 'instanceCreated', function( ev )
    {
        ev.editor.on( 'someEvent', function() { ... } );
    });

editor.replace( 'editor1' );

There should be instead a way to do that on instance creation, just like this:

editor.replace( 'editor1',
    {
        // ... some editor settings

        on :
        {
            someEvent : function() { ... },
            otherEvent : function() { ... }
        }
    });

Attachments (1)

3173.patch (923 bytes) - added by Frederico Caldeira Knabben 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by Frederico Caldeira Knabben

Attachment: 3173.patch added

comment:1 Changed 9 years ago by Frederico Caldeira Knabben

Keywords: Review? added
Status: newassigned

comment:2 Changed 9 years ago by Artur Formella

Keywords: Review+ added; Review? removed

comment:3 Changed 9 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: assignedclosed

Fixed with [3267].

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