Merge pull request #123 from medialab-prado/120-hidden-comments
Several comments boxes
This commit is contained in:
@@ -37,7 +37,9 @@ App.LegislationAnnotatable =
|
||||
return
|
||||
|
||||
renderAnnotationComments: (event) ->
|
||||
$('#comments-box').css({top: event.offset - $('.calc-comments').offset().top})
|
||||
if event.offset
|
||||
$("#comments-box").css({top: event.offset - $('.calc-comments').offset().top})
|
||||
|
||||
if App.LegislationAnnotatable.isMobile()
|
||||
return
|
||||
|
||||
@@ -58,17 +60,30 @@ App.LegislationAnnotatable =
|
||||
$('[data-annotation-id]').removeClass('current-annotation')
|
||||
|
||||
target = $(this)
|
||||
|
||||
parents = target.parents('.annotator-hl')
|
||||
parents_ids = parents.map (_, elem) ->
|
||||
$(elem).data("annotation-id")
|
||||
|
||||
annotation_id = target.data('annotation-id')
|
||||
$('[data-annotation-id="'+annotation_id+'"]').addClass('current-annotation')
|
||||
|
||||
$('#comments-box').html('')
|
||||
App.LegislationAllegations.show_comments()
|
||||
$("#comments-box").show()
|
||||
|
||||
$.event.trigger
|
||||
type: "renderLegislationAnnotation"
|
||||
annotation_id: target.data("annotation-id")
|
||||
annotation_url: target.closest(".legislation-annotatable").data("legislation-annotatable-base-url")
|
||||
offset: target.offset()["top"]
|
||||
|
||||
parents_ids.each (i, pid) ->
|
||||
$.event.trigger
|
||||
type: "renderLegislationAnnotation"
|
||||
annotation_id: pid
|
||||
annotation_url: target.closest(".legislation-annotatable").data("legislation-annotatable-base-url")
|
||||
|
||||
isMobile: () ->
|
||||
return window.innerWidth <= 652
|
||||
|
||||
@@ -126,6 +141,7 @@ App.LegislationAnnotatable =
|
||||
if $("span[data-annotation-id='" + ann_id + "']").length
|
||||
el = $("span[data-annotation-id='" + ann_id + "']")
|
||||
el.addClass('current-annotation')
|
||||
$('#comments-box').html('')
|
||||
App.LegislationAllegations.show_comments()
|
||||
$('html,body').animate({scrollTop: el.offset().top})
|
||||
$.event.trigger
|
||||
|
||||
@@ -827,14 +827,18 @@ $epigraph-line-height: rem-calc(22);
|
||||
display: none;
|
||||
}
|
||||
|
||||
#comments-box {
|
||||
position: absolute;
|
||||
top: 230px;
|
||||
}
|
||||
|
||||
.comment-box {
|
||||
width: 375px;
|
||||
padding: 1rem;
|
||||
background: #F9F9F9;
|
||||
border: 1px solid $border;
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 230px;
|
||||
margin-bottom: 2rem;
|
||||
|
||||
.button {
|
||||
font-size: $small-font-size;
|
||||
@@ -986,14 +990,6 @@ $epigraph-line-height: rem-calc(22);
|
||||
}
|
||||
}
|
||||
|
||||
.comment-box:nth-child(4) {
|
||||
top: 838px;
|
||||
}
|
||||
|
||||
.comment-box:nth-child(5) {
|
||||
top: 2035px;
|
||||
}
|
||||
|
||||
.draft-panel {
|
||||
background: #E5E5E5;
|
||||
border-left: 1px solid #D4D4D4;
|
||||
|
||||
Reference in New Issue
Block a user