diff options
-rw-r--r-- | app/helpers/journals_helper.rb | 20 |
1 files changed, 9 insertions, 11 deletions
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 |