diff --git a/app/assets/javascripts/legislation_annotatable.js b/app/assets/javascripts/legislation_annotatable.js index 3959dc5eb..85743b305 100644 --- a/app/assets/javascripts/legislation_annotatable.js +++ b/app/assets/javascripts/legislation_annotatable.js @@ -40,8 +40,10 @@ }, renderAnnotationComments: function(event) { if (event.offset) { + var default_top = $(".calc-comments").offset().top + $(".calc-comments .draft-panel").outerHeight(); + $("#comments-box").css({ - top: event.offset - $(".calc-comments").offset().top + top: event.offset - default_top }); } if (App.LegislationAnnotatable.isMobile()) { diff --git a/app/assets/stylesheets/legislation_process.scss b/app/assets/stylesheets/legislation_process.scss index 74f034606..a10744841 100644 --- a/app/assets/stylesheets/legislation_process.scss +++ b/app/assets/stylesheets/legislation_process.scss @@ -380,17 +380,26 @@ @include breakpoint(medium) { display: flex; - padding-left: rem-calc(15); - padding-right: rem-calc(15); - } - @media screen and (min-width: 40em) { .calc-index { - width: calc(35% - 25px); + max-width: calc(35% - 25px); + + > * { + padding-right: rem-calc(20); + } } .calc-text { - width: calc(65% - 25px); + flex: 1; + } + + .calc-comments { + min-width: 15rem; + width: calc(35% - 25px); + + > * { + padding-left: rem-calc(20); + } } } @@ -467,6 +476,8 @@ padding: rem-calc(16); @include breakpoint(medium) { + margin: 0 auto; + max-width: 3 * $grid-row-width / 4; padding: rem-calc(32) rem-calc(32) rem-calc(32) rem-calc(48); } @@ -533,6 +544,7 @@ } @include breakpoint(medium) { + min-width: auto; width: rem-calc(50); .draft-panel { @@ -561,7 +573,6 @@ } .calc-text { - width: calc(65% - 25px); border-right: 0; .show-comments { @@ -581,7 +592,6 @@ .calc-comments { background: #fff; cursor: auto; - width: calc(35% - 25px); @include breakpoint(small only) { summary { @@ -594,12 +604,11 @@ } .comments-box-container { - position: absolute; - top: rem-calc(230); + position: relative; + top: rem-calc(180); } .comment-box { - width: rem-calc(375); padding: rem-calc(4); background: #f9f9f9; border: 1px solid $border; diff --git a/app/views/legislation/draft_versions/_comments_panel.html.erb b/app/views/legislation/draft_versions/_comments_panel.html.erb index c9367f7e8..178fca4e3 100644 --- a/app/views/legislation/draft_versions/_comments_panel.html.erb +++ b/app/views/legislation/draft_versions/_comments_panel.html.erb @@ -1,4 +1,4 @@ -
+
<%= t("legislation.draft_versions.show.text_comments") %> diff --git a/app/views/legislation/draft_versions/show.html.erb b/app/views/legislation/draft_versions/show.html.erb index 428a07d7c..f4f1ad0ed 100644 --- a/app/views/legislation/draft_versions/show.html.erb +++ b/app/views/legislation/draft_versions/show.html.erb @@ -42,8 +42,8 @@ <%= render "legislation/processes/help_gif" %> -
-
+
+
<%= t("legislation.draft_versions.show.text_toc") %> @@ -53,7 +53,7 @@ <%= AdminLegislationSanitizer.new.sanitize(@draft_version.toc_html) %>
-
+
<%= t("legislation.draft_versions.show.text_body") %>
@@ -72,7 +72,7 @@
<% if @draft_version.final_version? %> -
+
<% else %> <%= render "comments_panel", draft_version: @draft_version %> <% end %>