diff --git a/app/views/wkexpense/edit.html.erb b/app/views/wkexpense/edit.html.erb index 1ba997c8..7a6726ff 100644 --- a/app/views/wkexpense/edit.html.erb +++ b/app/views/wkexpense/edit.html.erb @@ -19,9 +19,6 @@ Setting.plugin_redmine_wktime['wktime_enter_comment_in_row'].to_i == 1 %> commentInRow = true; <% end %> - withCommantImg = '<%= image_tag('withcommant.png', plugin: 'redmine_wktime') %>'; - withoutcommantImg = '<%= image_tag('withoutcommant.png', plugin: 'redmine_wktime') %>'; -
diff --git a/app/views/wktime/edit.html.erb b/app/views/wktime/edit.html.erb index dfc8c2c5..745b03cf 100644 --- a/app/views/wktime/edit.html.erb +++ b/app/views/wktime/edit.html.erb @@ -43,8 +43,6 @@ Setting.plugin_redmine_wktime['wktime_enter_comment_in_row'].to_i == 1 %> commentInRow = true; <% end %> - withCommantImg = '<%= image_tag('withcommant.png', plugin: 'redmine_wktime') %>'; - withoutcommantImg = '<%= image_tag('withoutcommant.png', plugin: 'redmine_wktime') %>';
diff --git a/assets/javascripts/edit.js b/assets/javascripts/edit.js index 3f327faa..dc20cf22 100644 --- a/assets/javascripts/edit.js +++ b/assets/javascripts/edit.js @@ -31,6 +31,8 @@ var minHourperWeekAlertMsg=""; var maxHourperWeekAlertMsg=""; var attachmentDiv = ""; var attachmentField = ""; +var withCommantSrc = RAILS_ASSET_URL('/plugin_assets/redmine_wktime/withcommant.png'); +var withoutCommantSrc = RAILS_ASSET_URL('/plugin_assets/redmine_wktime/withoutcommant.png'); $(document).ready(function() { var e_comments = $( "#_edit_comments_" ); @@ -102,11 +104,11 @@ $(document).ready(function() { var x = document.getElementsByName("custfield_img"+comment_row+"[]"); if( ((e_comments.val() != "" || custFldToolTip) && (!commentInRow || custFldToolTip )) || $("#attachment_" + comment_row + "_" + comment_col + " .attachments_fields").children().length > 0) { - $(x[comment_col-1]).replaceWith(withCommantImg); + $(x[comment_col-1]).attr({src: withCommantSrc}); } else { - $(x[comment_col-1]).replaceWith(withoutcommantImg); + $(x[comment_col-1]).attr({src: withoutCommantSrc}); } $(attachmentField).appendTo(attachmentDiv); $( this ).dialog( "close" );