]> source.dussan.org Git - redmine.git/commitdiff
Code cleanup.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 20 Jan 2016 11:31:41 +0000 (11:31 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 20 Jan 2016 11:31:41 +0000 (11:31 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@15073 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/journals_helper.rb

index 00194dbd0daaed985211decf759248ce223538a0..0b57e1acb6875caa91689aef9f3378132eb771af 100644 (file)
@@ -37,17 +37,20 @@ module JournalsHelper
                        :title => l(:button_quote),
                        :class => 'icon-only icon-comment'
                       ) if options[:reply_links]
-      links << link_to_in_place_notes_editor('', "journal-#{journal.id}-notes",
-                                             { :controller => 'journals', :action => 'edit', :id => journal, :format => 'js' },
-                                             :title => l(:button_edit),
-                                             :class => 'icon-only icon-edit'
-                                            ) if editable
+      links << link_to('',
+                       {:controller => 'journals', :action => 'edit', :id => journal},
+                       :remote => true,
+                       :method => 'get',
+                       :title => l(:button_edit),
+                       :class => 'icon-only icon-edit'
+                      ) if editable
       links << link_to('',
                        {:controller => 'journals', :action => 'edit', :id => journal, :notes => ""},
                        :remote => true,
                        :method => :post, :data => {:confirm => l(:text_are_you_sure)}, 
                        :title => l(:button_delete),
-                       :class => 'icon-only icon-del') if editable
+                       :class => 'icon-only icon-del'
+                      ) if editable
     end
     content << content_tag('div', links.join(' ').html_safe, :class => 'contextual') unless links.empty?
     content << textilizable(journal, :notes)
@@ -55,9 +58,4 @@ module JournalsHelper
     css_classes << " editable" if editable
     content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes)
   end
-
-  def link_to_in_place_notes_editor(text, field_id, url, options={})
-    onclick = "$.ajax({url: '#{url_for(url)}', type: 'get'}); return false;"
-    link_to text, '#', options.merge(:onclick => onclick)
-  end
 end