diff --git a/app/assets/javascripts/legislation_annotatable.js.coffee b/app/assets/javascripts/legislation_annotatable.js.coffee index cc238835e..5a9481e64 100644 --- a/app/assets/javascripts/legislation_annotatable.js.coffee +++ b/app/assets/javascripts/legislation_annotatable.js.coffee @@ -75,22 +75,23 @@ App.LegislationAnnotatable = $('#new_legislation_annotation #legislation_annotation_ranges').val(JSON.stringify(@annotation.ranges)) $('#comments-box').css({top: position.top - $('.calc-comments').offset().top}) - App.LegislationAnnotatable.highlight('#7fff9a') - $('#comments-box textarea').focus() + unless $('[data-legislation-open-phase]').data('legislation-open-phase') == false + App.LegislationAnnotatable.highlight('#7fff9a') + $('#comments-box textarea').focus() - $("#new_legislation_annotation").on("ajax:complete", (e, data, status, xhr) -> - if data.status == 200 - App.LegislationAnnotatable.remove_highlight() - $("#comments-box").html("").hide() - $.ajax - method: "GET" - url: annotation_url + "/annotations/" + data.responseJSON.id + "/comments" - dataType: 'script' - else - $(e.target).find('label').addClass('error') - $('' + data.responseJSON[0] + '').insertAfter($(e.target).find('textarea')) - return true - ) + $("#new_legislation_annotation").on("ajax:complete", (e, data, status, xhr) -> + if data.status == 200 + App.LegislationAnnotatable.remove_highlight() + $("#comments-box").html("").hide() + $.ajax + method: "GET" + url: annotation_url + "/annotations/" + data.responseJSON.id + "/comments" + dataType: 'script' + else + $(e.target).find('label').addClass('error') + $('' + data.responseJSON[0] + '').insertAfter($(e.target).find('textarea')) + return true + ) return ).bind(this) diff --git a/app/views/legislation/annotations/_form.html.erb b/app/views/legislation/annotations/_form.html.erb index a757b4612..f0a64e7ac 100644 --- a/app/views/legislation/annotations/_form.html.erb +++ b/app/views/legislation/annotations/_form.html.erb @@ -1,9 +1,6 @@
<%= t('legislation.annotations.comments.comments_count', count: 0) %>
- <%= link_to '#' do %> - - <% end %>
diff --git a/app/views/legislation/annotations/_version_chooser.html.erb b/app/views/legislation/annotations/_version_chooser.html.erb index 8cf4f5fc4..2b98cd90a 100644 --- a/app/views/legislation/annotations/_version_chooser.html.erb +++ b/app/views/legislation/annotations/_version_chooser.html.erb @@ -11,6 +11,6 @@ <%= t('legislation.draft_versions.show.updated_at', date: format_date(@draft_version.updated_at)) %>
- <%= link_to t('.see_text'), legislation_process_draft_version_annotations_path(process, draft_version), title: t('.see_text'), class: "button strong" %> + <%= link_to t('.see_text'), legislation_process_draft_version_path(process, draft_version), title: t('.see_text'), class: "button strong" %>