From 667d86788ea0405020fe743d0a495bd2d11fec86 Mon Sep 17 00:00:00 2001 From: Fernando Blat Date: Mon, 13 Feb 2017 10:12:03 +0100 Subject: [PATCH] Fix annotation highlighting for multimode annotation --- app/assets/javascripts/legislation_annotatable.js.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/legislation_annotatable.js.coffee b/app/assets/javascripts/legislation_annotatable.js.coffee index 76fc97ed6..16d5d94b2 100644 --- a/app/assets/javascripts/legislation_annotatable.js.coffee +++ b/app/assets/javascripts/legislation_annotatable.js.coffee @@ -56,7 +56,14 @@ App.LegislationAnnotatable = return $('[data-annotation-id]').removeClass('current-annotation') - $(this).addClass('current-annotation') + + parent = $(this).parents('[data-annotation-id]:eq(0)') + if parent.length + target = parent + else + target = $(this) + annotation_id = target.data('annotation-id') + $('[data-annotation-id="'+annotation_id+'"]').addClass('current-annotation') App.LegislationAllegations.show_comments() $("#comments-box").show()