Permalink
Browse files

fix bug #2310

IE7 clone node
(http://msdn.microsoft.com/en-us/library/ie/ms536365(v=vs.85).aspx)
have problem when cloning element with id attribute stetted.
  • Loading branch information...
1 parent a4da42b commit 5b0f63cf6b4c227603eb9f83399b9a0284f97bd7 Cristian Carlesso committed Jul 30, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 Source/Element/Element.js
@@ -818,7 +818,16 @@ Element.implement({
clone: function(contents, keepid){
contents = contents !== false;
+ var oldID;
+ /*<ltIE8>*/
+ if(Browser.ie6 || Browser.ie7 && !keepid){
+ oldID = this.removeAttribute('id');
+ }
+ /*</ltIE8>*/
var clone = this.cloneNode(contents), ce = [clone], te = [this], i;
+ /*<ltIE8>*/
+ oldID && Browser.ie6 || Browser.ie7 && this.setAttribute('id', oldID);
+ /*</ltIE8>*/
if (contents){
ce.append(Array.from(clone.getElementsByTagName('*')));

0 comments on commit 5b0f63c

Please sign in to comment.