[Prototype-core] new swap method for elements

2008-09-23 Thread Diego Perini
Hi all, I was reading in some LightHouse comments about the new swap method on elements and was wondering if the following is interesting for that matter. I had it written this way in my simple code: // nodes to swap (t)arget node, (s)econdary node swapNodes: function(t, s) { var n =

[Prototype-core] Re: 1.6.0.3 status: Where we're at

2008-09-23 Thread T.J. Crowder
I didn't hijacked anyone's thread. That's a matter of opinion. In *my* opinion, not hijacking the thread would have looked like this: I'd really like to see a fix for bug #1234 (error using update() on 'object' elements) in 1.6.0.3, it's a serious problem. And, er, yes, that *would* have

[Prototype-core] Re: new swap method for elements

2008-09-23 Thread John-David Dalton
Awesome use of nextSibling and parentNode! I have added my version which checks for the existence of the element.swapNode method (in IE). You can find it posted in the ticket. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Prototype-core] Re: new swap method for elements

2008-09-23 Thread kangax
On Sep 23, 11:25 am, John-David Dalton [EMAIL PROTECTED] wrote: @Tag can you provide a case where this would be a real issue ? I can't see someone swapping nodes with the document.documentElement or anything. I think `Element.replace` is a good way to ensure no cross-browser bugs crawl in

[Prototype-core] Re: new swap method for elements

2008-09-23 Thread EMoreth
Shouldnt it use the parent node of both elements ?? Cause if i decide to swap 'div1' and 'div2' here ill have no nextSibling (assuming that no textNodes would be returned as siblings)... div div div id=div1/div /div div div id=div2/div /div /div EMoreth On Sep 23, 5:04 

[Prototype-core] Re: new swap method for elements

2008-09-23 Thread Simon Charette
Using native IE method (swapNode) might help for weird issues in table. http://msdn.microsoft.com/en-us/library/ms536774(VS.85).aspx if (element.swapNode) return element.swapNode(secondElement); 2008/9/23 EMoreth [EMAIL PROTECTED] Shouldnt it use the parent node of both elements ?? Cause

[Prototype-core] Re: new swap method for elements

2008-09-23 Thread John-David Dalton
@Kangax I am not aware of any issues with insertBefore and table elements. I know that IE has issues with innerHTML and table/select elements. @EMoreth if nextSibling is null insertBefore will act as appendChild so it should still work out.