This project is archived and is in readonly mode.

#173 ✓invalid
Jonathan R.-Brochu

Docs: Wrong event keys for Fx:constructor options

Reported by Jonathan R.-Brochu | June 28th, 2008 @ 04:00 AM | in 2.0 (closed)

The documentation (MooTools v1.2) for the Fx base class [http://docs.mootools.net/Fx/Fx] is misleading toward keys that should be used in options for setting event handlers in Fx-derived classes.

The documentation states that the following keys should be used for setting event handlers:

  • start - [..]
  • cancel - [..]
  • complete - [..]
  • chainComplete - [..]

Instead, it should read:

  • onStart - [..]
  • onCancel - [..]
  • onComplete - [..]
  • chainComplete - [..]

(Unless I'm mistaken, "chainComplete" is valid here)

Maybe it should be added that when events are manipulated using methods provided by the Events utility class being implemented (addEvent/s(), fireEvent() and removeEvent/s() ), 'start', 'cancel' and 'complete' should be used as the event type (following logic for DOM events).

// event added within options
var myFx = new Fx.Tween(elem, {
    onComplete: myCompleteFn
});

// event added using addEvent()
myFx.addEvent('complete', myCompleteFn);

Comments and changes to this ticket

  • Jonathan R.-Brochu

    Jonathan R.-Brochu July 17th, 2008 @ 11:00 PM

    • Title changed from “Misdocumented event keys for Fx:constructor options” to “Docs: Wrong event keys for Fx:constructor options”
  • Jan Kassens

    Jan Kassens July 26th, 2008 @ 09:13 AM

    • State changed from “new” to “invalid”
    • Assigned user changed from “Valerio” to “Jan Kassens”

    If you want to attach the events in the constructor you need to prepend 'on' folllowed by an uppercase letter. This is documented in the Class.Extras docs.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Tags

Pages