Make draft version content use the empty space

Now that comments and TOC can be closed at the same time, we use a flex
layout so the main content uses the available width.

We're also making the comments work better on medium-sized screens,
since previously they had a fixed width and now the width is adapted to
the size of the screen.

Since now the comment box element has a relative position instead of an
absolute one, we need to consider the draft panel height when
calculating the comment box position.
This commit is contained in:
Javi Martín
2020-11-14 19:26:59 +01:00
parent 41e5ddbcdf
commit 48daf22f31
4 changed files with 28 additions and 17 deletions

View File

@@ -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()) {