# HG changeset patch # User luisf # Date 1317229721 -3600 # Node ID 3c1257f96b7911bf76c26ad4e9c6ad690086d9b4 # Parent 1ea217fdcdbfe40e8a70d2637d2ca11f1815625b not working: tried to add js to edit/save button diff -r 1ea217fdcdbf -r 3c1257f96b79 vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml --- a/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml Wed Sep 28 16:41:30 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml Wed Sep 28 18:08:41 2011 +0100 @@ -48,7 +48,7 @@ <%- if params[:action] == 'new' -%> <%= button_to_function l(:label_save_author), {}, { :onclick => "toggle_save_author(#{form_object_id(f.object_name)}); return false;", :id => form_tag_id( f.object_name, :edit_save_button ), :class => 'edit-save-button' } %> <%- else -%> - <%= button_to_function l(:label_edit_author), {}, { :onclick => "toggle_save_author(#{form_object_id(f.object_name)}); return false;", :id => form_tag_id( f.object_name, :edit_save_button )} %> + <%= button_to_function l(:label_edit_author), {}, { :onclick => "toggle_save_author(#{form_object_id(f.object_name)}); return false;", :id => form_tag_id( f.object_name, :edit_save_button ), :class => 'edit-save-button' } %> <%- end -%> diff -r 1ea217fdcdbf -r 3c1257f96b79 vendor/plugins/redmine_bibliography/assets/javascripts/authors.js --- a/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js Wed Sep 28 16:41:30 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js Wed Sep 28 18:08:41 2011 +0100 @@ -99,12 +99,7 @@ Publication.Authorships.add() } - // $(this).previous('div').down('.edit-save-button').observe('click', function(event){ - // alert(Event.element(event).innerHTML); - // alert($(this).id); - // }) - - + // ~ Pulication.Authorships }; @@ -117,6 +112,13 @@ add: function(){ alert("Button Pressed"); + + self.previous('div').down('.edit-save-button').observe('click', function(event){ + alert(Event.element(event).innerHTML); + alert(self.id); + }) + + },