[Prototype-core] Re: readAttribute() differences IE and Firefox

2008-02-12 Thread John-David Dalton
i will ass ^ $ no need to go looping --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send

[Prototype-core] Re: How can I access the object when using each?

2008-02-12 Thread Ken Snyder
kojilab wrote: Hi I have an object with a method I call run that iterates over some form elements. I want to be able to execute a method of that object on each element. But when I use this in the function within the each() statement, obviously the this doesn't correspond to the object

[Prototype-core] Re: readAttribute() differences IE and Firefox

2008-02-12 Thread John-David Dalton
this patch doesn't solve the issue entirely if you have a child element with the id=parentNode and the parent element tries element.parentNode it will return the child with the id parentNode. bummer. --~--~-~--~~~---~--~~ You received this message because you are

[Prototype-core] Re: readAttribute() differences IE and Firefox

2008-02-12 Thread John-David Dalton
http://dev.rubyonrails.org/ticket/11092 updated the ticket with an alternative fix which works for everything except child elements with duplicate id's. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype:

[Prototype-core] Re: How can I access the object when using each?

2008-02-12 Thread kojilab
Hi Ken and Jon Thanks for the info. Since I am not super familiar with the object model in prototype, what would be the full code to call this doSomething method within the each() function Thanks again On Feb 12, 12:28 pm, Ken Snyder [EMAIL PROTECTED] wrote: kojilab wrote: Hi I have an

[Prototype-core] Re: readAttribute() differences IE and Firefox

2008-02-12 Thread John-David Dalton
woopsie *add, and ticket updated thanks Ken! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group,

[Prototype-core] Re: readAttribute() differences IE and Firefox

2008-02-12 Thread Ken Snyder
John-David Dalton wrote: ticket + patch for the bug: http://dev.rubyonrails.org/ticket/11092 Spiffy use of clone. Won't the line /name|id/.test(name) catch attributes such as myid? Would ['name', 'id'].include(name) be better? Or you could just add ^ and $. - Ken

[Prototype-core] Re: How can I access the object when using each?

2008-02-12 Thread Jon L.
For further info: http://prototypejs.org/api/function/bind - Jon L. On Feb 12, 2:24 pm, Jon L. [EMAIL PROTECTED] wrote: You can use the bind method. this.formElements.each(function (el, index) { ... }.bind(this)); - Jon L. On Feb 12, 2:05 pm, kojilab [EMAIL PROTECTED] wrote: Hi

[Prototype-core] Re: readAttribute() differences IE and Firefox

2008-02-12 Thread John-David Dalton
ticket + patch for the bug: http://dev.rubyonrails.org/ticket/11092 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To

[Prototype-core] Re: readAttribute() differences IE and Firefox

2008-02-12 Thread Doctuh
No I take that back, I think identity is susceptible to the same problem. On Feb 12, 12:42 pm, Doctuh [EMAIL PROTECTED] wrote: Something I forgot to add: using the .identify() method on the form avoids this problem entirely. --~--~-~--~~~---~--~~ You received

[Prototype-core] Re: readAttribute() differences IE and Firefox

2008-02-12 Thread Jon L.
You may be better treating id as a property (or, elem.id) vs. attribute. 'id' isn't a member of the attributes object in FF; which, I'd assume, has at least some influence on getAttribute (maybe not). - Jon L. On Feb 12, 1:16 pm, Ken Snyder [EMAIL PROTECTED] wrote: Doctuh wrote: ... form

[Prototype-core] Re: readAttribute() differences IE and Firefox

2008-02-12 Thread Doctuh
Something I forgot to add: using the .identify() method on the form avoids this problem entirely. On Feb 12, 12:37 pm, Doctuh [EMAIL PROTECTED] wrote: My first post. This is to document a tricky thing I found while using Element.readAttribute() on a form. This post is to help the next person

[Prototype-core] readAttribute() differences IE and Firefox

2008-02-12 Thread Doctuh
My first post. This is to document a tricky thing I found while using Element.readAttribute() on a form. This post is to help the next person looking for an answer on it. ex: form id=foo input type=hidden name=id' value=bar / /form If you have a form with a hidden form element named 'id', and

[Prototype-core] Re: Event.isLeftClick() vs. click event in IE

2008-02-12 Thread artemy tregoubenko
BTW, your example in IE6 produces following results: for click: Left click: You clicked with your button. Event.button = 0 and Event.which = undefined Right and middle click: no effect, as expected for mousedown, as expected: Left click: You clicked with your Left button. Event.button = 1 and

[Prototype-core] Re: Event.isLeftClick() vs. click event in IE

2008-02-12 Thread Richard Quadling
On 12/02/2008, artemy tregoubenko [EMAIL PROTECTED] wrote: You'll be surprised that click _can_ be toggled via keyboard (FF, Opera for sure). You may easily test this. And my first example shows how isLeftClick is broken in IE6. I can't forget about IE6. Ah. Yes. on clickable objects

[Prototype-core] Re: Event.isLeftClick() vs. click event in IE

2008-02-12 Thread Richard Quadling
On 12/02/2008, artemy tregoubenko [EMAIL PROTECTED] wrote: I don't want to break keyboard navigation only because of IE problem. mousedown and click are both non-keyboard events. but click is only for left button. This is true for IE (7 on WinXPSP2) and FF (2.0.0.1 on WinXPSP2). Here is a

[Prototype-core] Re: Event.isLeftClick() vs. click event in IE

2008-02-12 Thread artemy tregoubenko
On 2/12/08, Richard Quadling [EMAIL PROTECTED] wrote: On 12/02/2008, artemy tregoubenko [EMAIL PROTECTED] wrote: You'll be surprised that click _can_ be toggled via keyboard (FF, Opera for sure). You may easily test this. And my first example shows how isLeftClick is broken in IE6. I