From: Jean-Philippe Lang Date: Wed, 20 Jan 2016 11:31:41 +0000 (+0000) Subject: Code cleanup. X-Git-Tag: 3.3.0~297 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e2a999743e972f56dbd0e9b20bb7facb9a4a672d;p=redmine.git Code cleanup. git-svn-id: http://svn.redmine.org/redmine/trunk@15073 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb index 00194dbd0..0b57e1acb 100644 --- a/app/helpers/journals_helper.rb +++ b/app/helpers/journals_helper.rb @@ -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