From 5de81825cac178de1a3938b30130ab322befeb97 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Wed, 13 May 2009 21:40:53 +0200 Subject: [PATCH] fix #892. The spinner was never removed. In the normal case this didn't matter because the whole edit form was removed anyway. But in case of an error, the form remained visible and the submit button was not accessable anymore. fixed by keeping track of the last spinning submit button for todos --- app/helpers/todos_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 2cddf944..a991a80f 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -16,8 +16,8 @@ module TodosHelper &block ) apply_behavior 'form.edit_todo_form', make_remote_form( :method => :put, - :before => "this.down('button.positive').startWaiting()", - :loaded => "this.down('button.positive').stopWaiting()", + :before => "todoSpinner = this.down('button.positive'); todoSpinner.startWaiting()", + :loaded => "todoSpinner.stopWaiting()", :condition => "!(this.down('button.positive').isWaiting())"), :prevent_default => true end