Make sure Form.reset always returns a reference to the receiver element. [#309 state:resolved] (Phil, kangax)

This commit is contained in:
Andrew Dupont 2009-02-22 15:11:40 -06:00
parent 97fc24a0b2
commit dc9d274d89
3 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,5 @@
* Make sure Form.reset always returns a reference to the receiver element. [#309 state:resolved] (Phil, kangax)
* Escape ":" and "." characters when doing contextual CSS selection in browsers that support querySelectorAll. [#559 state:resolved] (fxtentacle, Andrew Dupont)
* Ensure the `target` property on events is never undefined in IE. [#383 state:resolved] (Mathias Karstädt, Diego Perini, Andrew Dupont)

View File

@ -1,6 +1,7 @@
var Form = {
reset: function(form) {
$(form).reset();
form = $(form);
form.reset();
return form;
},

View File

@ -26,6 +26,10 @@ new Test.Unit.Runner({
this.assertEqual("4", $F("input_enabled"));
},
testFormReset: function() {
this.assertRespondsTo('reset', Form.reset('form'));
},
testFormElementEventObserver: function(){
var callbackCounter = 0;
var observer = new Form.Element.EventObserver('input_enabled', function(){