Merge pull request #67 from medialab-prado/65-remove-hightligthing

Remove highligthing and fix links
This commit is contained in:
Fernando Blat
2017-01-17 15:41:27 +01:00
committed by GitHub
3 changed files with 17 additions and 19 deletions

View File

@@ -75,22 +75,23 @@ App.LegislationAnnotatable =
$('#new_legislation_annotation #legislation_annotation_ranges').val(JSON.stringify(@annotation.ranges)) $('#new_legislation_annotation #legislation_annotation_ranges').val(JSON.stringify(@annotation.ranges))
$('#comments-box').css({top: position.top - $('.calc-comments').offset().top}) $('#comments-box').css({top: position.top - $('.calc-comments').offset().top})
App.LegislationAnnotatable.highlight('#7fff9a') unless $('[data-legislation-open-phase]').data('legislation-open-phase') == false
$('#comments-box textarea').focus() App.LegislationAnnotatable.highlight('#7fff9a')
$('#comments-box textarea').focus()
$("#new_legislation_annotation").on("ajax:complete", (e, data, status, xhr) -> $("#new_legislation_annotation").on("ajax:complete", (e, data, status, xhr) ->
if data.status == 200 if data.status == 200
App.LegislationAnnotatable.remove_highlight() App.LegislationAnnotatable.remove_highlight()
$("#comments-box").html("").hide() $("#comments-box").html("").hide()
$.ajax $.ajax
method: "GET" method: "GET"
url: annotation_url + "/annotations/" + data.responseJSON.id + "/comments" url: annotation_url + "/annotations/" + data.responseJSON.id + "/comments"
dataType: 'script' dataType: 'script'
else else
$(e.target).find('label').addClass('error') $(e.target).find('label').addClass('error')
$('<small class="error">' + data.responseJSON[0] + '</small>').insertAfter($(e.target).find('textarea')) $('<small class="error">' + data.responseJSON[0] + '</small>').insertAfter($(e.target).find('textarea'))
return true return true
) )
return return
).bind(this) ).bind(this)

View File

@@ -1,9 +1,6 @@
<div class="comment-header"> <div class="comment-header">
<span class="icon-comment" aria-hidden="true"></span> <span class="icon-comment" aria-hidden="true"></span>
<div class="comment-number"><%= t('legislation.annotations.comments.comments_count', count: 0) %></div> <div class="comment-number"><%= t('legislation.annotations.comments.comments_count', count: 0) %></div>
<%= link_to '#' do %>
<span class="icon-expand" aria-hidden="true"></span>
<% end %>
</div> </div>
<div class="comments-wrapper"> <div class="comments-wrapper">

View File

@@ -11,6 +11,6 @@
<span><%= t('legislation.draft_versions.show.updated_at', date: format_date(@draft_version.updated_at)) %></span> <span><%= t('legislation.draft_versions.show.updated_at', date: format_date(@draft_version.updated_at)) %></span>
</div> </div>
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<%= 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" %>
</div> </div>
</div> </div>