Skip to content

Commit

Permalink
Merge commit 'beanbag/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
tslocke committed Jun 23, 2008
2 parents d31a71c + 699e67c commit 669ee54
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions hobo/rails_generators/hobo_rapid/templates/hobo-rapid.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,15 @@ var Hobo = {

Hobo.showSpinner(options.message, options.spinnerNextTo)
var complete = function() {
if (form && options.resetForm) form.reset();
Hobo.hideSpinner();

if (options.onComplete)
options.onComplete.apply(this, arguments)
if (options.onComplete) options.onComplete.apply(this, arguments)
if (form && options.refocusForm) Form.focusFirstElement(form)
Event.addBehavior.reload()
}
var success = function() {
if (options.onSuccess) options.onSuccess.apply(this, arguments)
if (form && options.resetForm) form.reset();
}
if (options.method && options.method.toLowerCase() == "put") {
delete options.method
params.push("_method=PUT")
Expand All @@ -122,7 +123,7 @@ var Hobo = {
}
}

new Ajax.Request(url, Object.merge(options, { parameters: params.join("&"), onComplete: complete }))
new Ajax.Request(url, Object.merge(options, { parameters: params.join("&"), onComplete: complete, onSuccess: success }))
},

hide: function() {
Expand Down

0 comments on commit 669ee54

Please sign in to comment.