Merge pull request #57 from zhaospei/master
allow blog-box pre-expand-blog click
This commit is contained in:
commit
ec893149d1
1 changed files with 6 additions and 6 deletions
|
@ -32,15 +32,14 @@
|
||||||
{% block js_media %}
|
{% block js_media %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function activateBlogBoxOnClick() {
|
function activateBlogBoxOnClick() {
|
||||||
$('.show-more').on('click', function () {
|
$('.blog-box').on('click', function () {
|
||||||
var $blogbox = $(this).parent().parent();
|
var $description = $(this).children('.blog-description');
|
||||||
var $description = $blogbox.children('.blog-description');
|
|
||||||
var max_height = $description.css('max-height');
|
var max_height = $description.css('max-height');
|
||||||
if (max_height !== 'fit-content') {
|
if (max_height !== 'fit-content') {
|
||||||
$description.css('max-height', 'fit-content');
|
$description.css('max-height', 'fit-content');
|
||||||
$blogbox.css('cursor', 'auto');
|
$(this).css('cursor', 'auto');
|
||||||
$blogbox.removeClass('pre-expand-blog');
|
$(this).removeClass('pre-expand-blog');
|
||||||
$(this).hide();
|
$(this).children().children('.show-more').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -52,6 +51,7 @@
|
||||||
}
|
}
|
||||||
if ($content > $precontent - 30) {
|
if ($content > $precontent - 30) {
|
||||||
$(this).addClass('pre-expand-blog');
|
$(this).addClass('pre-expand-blog');
|
||||||
|
$(this).css('cursor', 'pointer');
|
||||||
} else {
|
} else {
|
||||||
$(this).children().children('.show-more').hide();
|
$(this).children().children('.show-more').hide();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue