This project is archived and is in readonly mode.

#926 ✓invalid
Daniele C.

Clarification and Possibly improvement for addEvent in 1.3

Reported by Daniele C. | June 8th, 2010 @ 05:09 PM | in 2.0 (closed)

Hi,
I was reading the Docs of the 1.3 beta version and I see that the bindWithEvent(scope) function will be deprecated in 1.3. Then, if I've understood correctly, something like:

var Myfunct = function(e){};
var MyScope = {};
document.id('MyLink').addEvent('click', Myfunct.bindWithEvent(MyScope));

Will be written

var Myfunct = function(e){};
var MyScope = {};
document.id('MyLink').addEvent('click', function(e){
   var Mybind = [e];
   Myfunct.bind(MyScope, Mybind);
});

Is it correct?

If so, I, personally, find this way not very elegant. I think would be more intuitive the use of a third argument in the addEvent function, like:

var Myfunct = function(e){};
var MyScope = {};
document.id('MyLink').addEvent('click', Myfunct, MyScope);

I think this could be a nice idea.

Bye,
D.

Comments and changes to this ticket

Create your profile

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

Shared Ticket Bins

Pages