fix pre-expand-blog check always true
This commit is contained in:
parent
4e7b8daada
commit
262514acee
4 changed files with 25 additions and 17 deletions
|
@ -228,6 +228,7 @@
|
|||
}
|
||||
|
||||
.show-more {
|
||||
display: flex;
|
||||
color: black;
|
||||
font-style: italic;
|
||||
font-size: 16px;
|
||||
|
@ -237,7 +238,6 @@
|
|||
position: absolute;
|
||||
inset: 50% 0px 0px;
|
||||
background: linear-gradient(transparent, white);
|
||||
display: flex;
|
||||
-webkit-box-pack: end;
|
||||
justify-content: flex-end;
|
||||
align-items: flex-end;
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
{% endwith %}
|
||||
<div class='blog-description content-description'>
|
||||
{{ comment.body|markdown(lazy_load=True)|reference|str|safe }}
|
||||
<div class="show-more"></div>
|
||||
<div class="show-more"> {{_("...More")}} </div>
|
||||
</div>
|
||||
</div>
|
|
@ -42,10 +42,18 @@
|
|||
$blogbox.removeClass('pre-expand-blog');
|
||||
$(this).hide();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('.blog-box').each(function () {
|
||||
if ($(this).prop('scrollHeight') > $(this).height()) {
|
||||
var $precontent = $(this).children('.blog-description').height();
|
||||
var $content = $(this).children().children('.content-description').height();
|
||||
if ($content == undefined) {
|
||||
$content = $(this).children().children('.md-typeset').height()
|
||||
}
|
||||
if ($content > $precontent - 30) {
|
||||
$(this).addClass('pre-expand-blog');
|
||||
} else {
|
||||
$(this).children().children('.show-more').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -21,6 +21,6 @@
|
|||
</div>
|
||||
<div class='blog-description content-description'>
|
||||
{{ ticket.messages.last().body|markdown(lazy_load=True)|reference|str|safe }}
|
||||
<div class="show-more"></div>
|
||||
<div class="show-more"> {{_("...More")}} </div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in a new issue