From 42c4c199a9785d9d4680d6f7d8921efaa3a1c633 Mon Sep 17 00:00:00 2001 From: Eric Allen Date: Sun, 7 Mar 2010 16:54:17 -0500 Subject: [PATCH] Move edit button out of dropdown menu Closes #976 --- app/helpers/todos_helper.rb | 14 ++++++-------- app/views/todos/_todo.html.erb | 6 +++--- public/javascripts/application.js | 11 +++++++++++ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 57331e01..8eafc567 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -24,14 +24,12 @@ module TodosHelper :class => "icon star_item", :title => "star the action '#{@todo.description}'") end - def remote_edit_menu_item(parameters, todo) - return link_to_remote( - image_tag("edit_off.png", :mouseover => "edit_on.png", :alt => "Edit", :align => "absmiddle", :id => 'edit_icon_todo_'+todo.id.to_s)+" Edit", - :url => {:controller => 'todos', :action => 'edit', :id => todo.id}, - :method => 'get', - :with => "'#{parameters}'", - :before => todo_start_waiting_js(todo), - :complete => todo_stop_waiting_js(todo)) + def remote_edit_button + link_to( + image_tag("blank.png", :alt => "Edit", :align => "absmiddle", :id => 'edit_icon_todo_'+@todo.id.to_s, :class => 'edit_item'), + {:controller => 'todos', :action => 'edit', :id => @todo.id}, + :class => "icon edit_item", + :title => "Edit the action '#{@todo.description}'") end def remote_delete_menu_item(parameters, todo) diff --git a/app/views/todos/_todo.html.erb b/app/views/todos/_todo.html.erb index 579ea766..4e325c8b 100644 --- a/app/views/todos/_todo.html.erb +++ b/app/views/todos/_todo.html.erb @@ -11,12 +11,12 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
<%= remote_star_icon %> <%= remote_toggle_checkbox unless source_view_is :deferred %> + <% unless suppress_edit_button %> + <%= remote_edit_button %> + <% end %>