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 @@