From e9501d63e51972f34e68acc665fb84c23a3d5a02 Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Sun, 11 Mar 2007 22:40:24 +0000 Subject: [PATCH] Make Element.extend work on IE for Nodes with the same ID that where discarded. --- CHANGELOG | 2 ++ src/dom.js | 2 +- test/unit/dom.html | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 0c8ebd6..029712f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Make Element.extend work on IE for Nodes with the same ID that where discarded. [Mislav Marohnić, Thomas Fuchs] + * Make Selector correctly extend the first element it returns on IE. [Thomas Fuchs] * Prevent a crash in Safari when using $A() on NodeList objects that contain text nodes. [Thomas Fuchs] diff --git a/src/dom.js b/src/dom.js index 50003fb..7c4de17 100644 --- a/src/dom.js +++ b/src/dom.js @@ -63,7 +63,7 @@ Element.extend = function(element) { element[property] = cache.findOrStore(value); } - element._extended = true; + element._extended = Prototype.emptyFunction; return element; }; diff --git a/test/unit/dom.html b/test/unit/dom.html index 2a924ee..0719f78 100644 --- a/test/unit/dom.html +++ b/test/unit/dom.html @@ -153,6 +153,8 @@
+
+
@@ -607,6 +609,12 @@ }); }}, + testElementExtendReextendsDiscardedNodes: function() {with(this) { + assertRespondsTo('show', $('discard_1')); + $('element_reextend_test').innerHTML += '
'; + assertRespondsTo('show', $('discard_1')); + }}, + testElementCleanWhitespace: function() {with(this) { Element.cleanWhitespace("test_whitespace"); assertEqual(3, $("test_whitespace").childNodes.length);