[Proto-Scripty] Re: Extending Event has a Bug ?

2008-12-18 Thread fero

On Dec 17, 11:52 pm, kangax kan...@gmail.com wrote:
 On Dec 17, 1:51 pm, fero elf...@gmail.com wrote:
 [...]

  I think it is quite a bug because I have to check for
  Prototype.Browser.IE variable.

 I'm pretty sure there's *no* bug in nonexistent `Event.addMethods` ; )

Yes, you are truly right ... it was just a joke :)


 Extending event objects is like playing with fire.

This is meaningful :)

Ok thank you for your answer

BTW with function.methodize I didn't succeded too.

fero
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Extending Event has a Bug ?

2008-12-17 Thread kangax

On Dec 17, 1:51 pm, fero elf...@gmail.com wrote:
[...]
 I think it is quite a bug because I have to check for
 Prototype.Browser.IE variable.

I'm pretty sure there's *no* bug in nonexistent `Event.addMethods` ; )

 If prototype supports IE and other browsers, in a very beautiful world
 I have never to do that check in my code :))

 Futhermore would you please plan a method Event.addMethods ?
 Or at least give me some hints so I can develop it for the community ?
 (but I don't know if in this moment my javascript knowledge is enough)

Extending event objects is like playing with fire. I don't suggest you
do it. Instead, either use procedural style or some kind of event
wrappers.

function getAbsoluteX(e) {
  var scroll = document.viewport.getScrollOffsets();
  return event.pointerX() + scroll.left;
}

// and then

someElement.observe('click', function(e) {
  console.log(getAbsoluteX(e));
  // etc.
})


 Thank you very much for all your work
 Listening for an answer...
 fero

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---