Opened 4 years ago

Closed 4 years ago

#9043 closed Bug (fixed)

undefined value afterCommandExec event

Reported by: the_fire_warrior Owned by: j.swiderski
Priority: Normal Milestone: CKEditor 3.6.4
Component: General Version: 3.0
Keywords: Cc:

Description

I want to do something after I click the new page button. To handle the event I do :

this.on('afterCommandExec', handleAfterCommandExec);
function handleAfterCommandExec(event) {
    var commandName = event.data.name;
    ...
}

When I click on a button, commandName has a value (undo, redo, about, ...) but with the new page button, commandName is undefined.

Attachments (2)

9043.patch (390 bytes) - added by j.swiderski 4 years ago.
9043_2.patch (435 bytes) - added by j.swiderski 4 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 4 years ago by j.swiderski

  • Status changed from new to confirmed
  • Version changed from 3.6.3 to 3.0

Reproducible from CKEditor 3.0.

Changed 4 years ago by j.swiderski

comment:2 Changed 4 years ago by j.swiderski

  • Owner set to j.swiderski
  • Status changed from confirmed to review

Could anyone verify if this is the correct way to fix this issue?

comment:3 Changed 4 years ago by fredck

  • Status changed from review to review_failed

There is no "name" property for the command object, in fact, so it is incorrect to create it in the command definition.

The right fix is to simply pass the string 'newpage' instead of command.name when firing "afterCommandExec" inside the newpage plugin.

Changed 4 years ago by j.swiderski

comment:4 Changed 4 years ago by j.swiderski

  • Status changed from review_failed to review

Attempt no. 2

comment:5 Changed 4 years ago by fredck

  • Milestone set to CKEditor 3.6.4
  • Status changed from review to review_passed

comment:6 Changed 4 years ago by j.swiderski

  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed with [7503].

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