diff --git a/app/views/contexts/create.js.rjs b/app/views/contexts/create.js.rjs index 89ee5d93..1d5e6f9f 100644 --- a/app/views/contexts/create.js.rjs +++ b/app/views/contexts/create.js.rjs @@ -1,12 +1,12 @@ if @saved + container_name = 'list-contexts-' + (@context.hidden? ? 'hidden' : 'active') page.hide 'contexts-empty-nd' - page.insert_html :bottom, "list-contexts", :partial => 'context_listing', :locals => { :context_listing => @context } - page.sortable "list-contexts", get_listing_sortable_options + page.insert_html :bottom, container_name, :partial => 'context_listing', :locals => { :context_listing => @context } page.hide 'status' page['badge_count'].replace_html @down_count - page.call "Form.reset", "context-form" - page.call "Form.focusFirstElement", "context-form" + page << '$("#context-form").clearForm();' + page << '$("#context-form input:first").focus();' else page.show 'status' page.replace_html 'status', "#{error_messages_for('context')}" -end \ No newline at end of file +end diff --git a/app/views/contexts/index.html.erb b/app/views/contexts/index.html.erb index 46426579..9d7ed3c2 100644 --- a/app/views/contexts/index.html.erb +++ b/app/views/contexts/index.html.erb @@ -15,9 +15,8 @@ :url => contexts_path, :method => :post, :html=> { :id => 'context-form', :name => 'context', :class => 'inline-form'}, - :before => "$('context_new_submit').startWaiting()", - :complete => "$('context_new_submit').stopWaiting()", - :condition => "!$('context_new_submit').isWaiting()") do -%> + :before => "$('#context_new_submit').block({message: null})", + :complete => "$('#context_new_submit').unblock()") do -%>
<%= error_messages_for('context') %>