Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Form.Request - `target` variable should have been `update` + some sma…

…ll code enhancements
  • Loading branch information...
commit 05a6613fea681f5a6cc8313a504f06006c3187b6 1 parent ab70b8f
@arian arian authored
Showing with 17 additions and 21 deletions.
  1. +17 −21 Source/Forms/Form.Request.js
View
38 Source/Forms/Form.Request.js
@@ -62,7 +62,7 @@ if (!window.Form) window.Form = {};
setTarget: function(target){
this.target = document.id(target);
- if (!this.request) {
+ if (!this.request){
this.makeRequest();
} else {
this.request.setOptions({
@@ -99,14 +99,14 @@ if (!window.Form) window.Form = {};
},
attachReset: function(){
- if (this.options.resetForm){
- this.request.addEvent('success', function(){
- Function.attempt(function(){
- this.element.reset();
- }.bind(this));
- if (window.OverText) OverText.update();
+ if (!this.options.resetForm) return this;
+ this.request.addEvent('success', function(){
+ Function.attempt(function(){
+ this.element.reset();
}.bind(this));
- }
+ if (window.OverText) OverText.update();
+ }.bind(this));
+ return this;
},
attach: function(attach){
@@ -189,20 +189,16 @@ if (!window.Form) window.Form = {};
});
- Element.implement({
-
- formUpdate: function(update, options){
- var fq = this.retrieve('form.request');
- if (!fq) {
- fq = new Form.Request(this, target, options);
- } else {
- if (update) fq.setTarget(document.id(update));
- if (options) fq.setOptions(options).makeRequest();
- }
- fq.send();
- return this;
+ Element.implement('formUpdate', function(update, options){
+ var fq = this.retrieve('form.request');
+ if (!fq) {
+ fq = new Form.Request(this, update, options);
+ } else {
+ if (update) fq.setTarget(update);
+ if (options) fq.setOptions(options).makeRequest();
}
-
+ fq.send();
+ return this;
});
})();
Please sign in to comment.
Something went wrong with that request. Please try again.