Skip to content

Commit

Permalink
Make sure Form.reset always returns a reference to the receiver eleme…
Browse files Browse the repository at this point in the history
…nt. [#309 state:resolved] (Phil, kangax)
  • Loading branch information
savetheclocktower committed Feb 22, 2009
1 parent 97fc24a commit dc9d274
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/dom/form.js
@@ -1,6 +1,7 @@
var Form = {
reset: function(form) {
$(form).reset();
form = $(form);
form.reset();
return form;
},

Expand Down
4 changes: 4 additions & 0 deletions test/unit/form_test.js
Expand Up @@ -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(){
Expand Down

0 comments on commit dc9d274

Please sign in to comment.