This project is archived and is in readonly mode.

#373 ✓invalid
Leon Radley

Class.Extras onEvent in options not lowercasing properly

Reported by Leon Radley | September 9th, 2008 @ 01:09 PM | in 2.0 (closed)


When creating your own class and initializing it with var myclass = new MyClass({ onMyEvent: function(){ ... } });

the proper way to fire this event would be to use fireEvent('myevent');

but since the function Events.removeOn = function(string){ return string.replace(/^on([A-Z])/, function(full, first) { return first.toLowerCase(); }); };

in Class.Extras only removes and lower cases the FIRST character and not all the characters.

your would have to use


this is inconsistent with mootools since native events are all in lowercase.

Comments and changes to this ticket

  • Jan Kassens

    Jan Kassens September 9th, 2008 @ 01:38 PM

    • State changed from “new” to “hold”
    • Tag cleared.
    • Assigned user changed from “Valerio” to “Jan Kassens”

    should we make all events case insensetive?

    needs discussion.

  • Daniel Steigerwald

    Daniel Steigerwald September 10th, 2008 @ 01:01 PM

    Javascript is case sensitive language, so any automatic case casting is not good idea, I think.

    If you look for consistency, just camelize your event names.

    new MyClass({ onMyevent: function(){ ... } });

    But I dont see uglyness to have native events in lowercase, and syntetic events in pascal case.

  • Christoph Pojer

    Christoph Pojer November 9th, 2010 @ 06:59 PM

    • State changed from “hold” to “invalid”
    • Milestone order changed from “0” to “0”

Create your profile

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

Shared Ticket Bins