diff --git a/CHANGELOG b/CHANGELOG index d7f464c..a02620e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix regression in which no-argument calls to Element.addMethods() would not add the methods defined in Form.Methods and Form.Element.Methods. Closes #8206. [Tobie Langel, fwittekind] + * Fix Element#readAttribute to work with the 'type' attribute in IE. Closes #8160. [Tobie Langel, Wiktor Ihárosi] *1.5.1_rc3* (April 24, 2007) diff --git a/src/dom.js b/src/dom.js index a0fb444..4d5e897 100644 --- a/src/dom.js +++ b/src/dom.js @@ -586,6 +586,18 @@ Element.hasAttribute = function(element, attribute) { Element.addMethods = function(methods) { var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; + + if (!methods) { + Object.extend(Form, Form.Methods); + Object.extend(Form.Element, Form.Element.Methods); + Object.extend(Element.Methods.ByTag, { + "FORM": Object.clone(Form.Methods), + "INPUT": Object.clone(Form.Element.Methods), + "SELECT": Object.clone(Form.Element.Methods), + "TEXTAREA": Object.clone(Form.Element.Methods) + }); + } + if (arguments.length == 2) { var tagName = methods; methods = arguments[1]; diff --git a/src/form.js b/src/form.js index f60c1d8..1fd5837 100644 --- a/src/form.js +++ b/src/form.js @@ -97,8 +97,6 @@ Form.Methods = { } } -Object.extend(Form, Form.Methods); - /*--------------------------------------------------------------------------*/ Form.Element = { @@ -167,14 +165,6 @@ Form.Element.Methods = { } } -Object.extend(Form.Element, Form.Element.Methods); -Object.extend(Element.Methods.ByTag, { - "FORM": Object.clone(Form.Methods), - "INPUT": Object.clone(Form.Element.Methods), - "SELECT": Object.clone(Form.Element.Methods), - "TEXTAREA": Object.clone(Form.Element.Methods) -}); - /*--------------------------------------------------------------------------*/ var Field = Form.Element; diff --git a/test/unit/element_mixins.html b/test/unit/element_mixins.html index afb3591..5851792 100644 --- a/test/unit/element_mixins.html +++ b/test/unit/element_mixins.html @@ -32,11 +32,19 @@