This project is archived and is in readonly mode.

#1212 ✓wontfix

[core 1.3.1 no-compat] Passing a function as option parameter of a Class gets "undefined" if implementing Options and Events

Reported by SunboX | April 8th, 2011 @ 10:17 AM | in 1.4.0 (closed)


This belongs to no-compat version of core 1.3.1 only!

If I define a new Class that implements Options and (!) Events, a options parameter containing a function will be set to undefined.

Tested in Firefox 4, IE 9, Safari 5.0.

Comments and changes to this ticket

  • SunboX

    SunboX April 8th, 2011 @ 10:19 AM

    • Tag set to 1.3.1 core, class, events, function, options, parameter
  • SunboX

    SunboX April 8th, 2011 @ 10:20 AM

    • Tag changed from 1.3.1 core, class, events, function, options, parameter to 1.3.1, class, core, events, function, options, parameter
  • Arian

    Arian April 8th, 2011 @ 11:59 AM

    • State changed from “new” to “wontfix”
    • Milestone set to 1.4.0
    • Milestone order changed from “909” to “0”

    This is intended behavior:

    The function is added as event, and can be fired by this.fireEvent('click')

    This is in all 1.3 versions as far as I can see.

  • SunboX

    SunboX April 8th, 2011 @ 02:11 PM

    That´s really bad behavior... it´s ok, if the function gets called by fireEvent ... but it shouldn´t be set to "undefined" in this.options.

  • Arian

    Arian April 8th, 2011 @ 05:23 PM

    • Assigned user set to “Christoph Pojer”

    Why do you need to access that function?
    If your option begins with another name, rather than with on you can just access it like any other option.

  • SunboX

    SunboX April 11th, 2011 @ 08:32 AM

    I can´t rename some options. Let´s say you want to use a third party framework like google maps in your class and you want to pass googles options as mootools-class-option. Now all funtions starting with "onX" will be set to "undefined". :/ You wonder why it didn´t work. So you have to pass these options as a second option value. That´s bad. Is it really necessary to set it to "undefined"?

Create your profile

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

Shared Ticket Bins

People watching this ticket