From 3bb77b75364e3f7e04eaa860c6b18ad9b57200d8 Mon Sep 17 00:00:00 2001 From: Fernando Blat Date: Thu, 19 Jan 2017 11:06:41 +0100 Subject: [PATCH] Only open annotations if the anchor is for an annotation --- app/assets/javascripts/legislation_annotatable.js.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/legislation_annotatable.js.coffee b/app/assets/javascripts/legislation_annotatable.js.coffee index 5a9481e64..0e7f1b4e1 100644 --- a/app/assets/javascripts/legislation_annotatable.js.coffee +++ b/app/assets/javascripts/legislation_annotatable.js.coffee @@ -100,7 +100,8 @@ App.LegislationAnnotatable = scrollToAnchor: -> annotationsLoaded: (annotations) -> - if anchor = $(location).attr('hash') + anchor = $(location).attr('hash') + if anchor && anchor.startsWith('#annotation') ann_id = anchor.split("-")[-1..] el = $("span[data-annotation-id='" + ann_id + "']") App.LegislationAllegations.show_comments()