blockquote fix again

v1.18.x
barisusakli 11 years ago
parent e6371ad539
commit 7d3d9f5ae1

@ -58,6 +58,8 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
enableInfiniteLoadingOrPagination(); enableInfiniteLoadingOrPagination();
addBlockQuoteHandler();
addBlockquoteEllipses($('.topic .post-content > blockquote')); addBlockquoteEllipses($('.topic .post-content > blockquote'));
handleBookmark(tid); handleBookmark(tid);
@ -150,21 +152,22 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
createNewPosts(data); createNewPosts(data);
} }
function addBlockquoteEllipses(blockquotes) { function addBlockQuoteHandler() {
blockquotes.each(function() {
var $this = $(this);
if ($this.find(':hidden').length && !$this.find('.toggle').length) {
$this.append('<i class="fa fa-angle-down pointer toggle"></i>');
}
});
$('#post-container').on('click', 'blockquote .toggle', function() { $('#post-container').on('click', 'blockquote .toggle', function() {
var blockQuote = $(this).parent('blockquote'); var blockQuote = $(this).parent('blockquote');
var toggle = $(this); var toggle = $(this);
blockQuote.toggleClass('uncollapsed'); blockQuote.toggleClass('uncollapsed');
var collapsed = !blockQuote.hasClass('uncollapsed'); var collapsed = !blockQuote.hasClass('uncollapsed');
toggle.toggleClass('fa-angle-down', collapsed).toggleClass('fa-angle-up', !collapsed); toggle.toggleClass('fa-angle-down', collapsed).toggleClass('fa-angle-up', !collapsed);
});
}
function addBlockquoteEllipses(blockquotes) {
blockquotes.each(function() {
var $this = $(this);
if ($this.find(':hidden').length && !$this.find('.toggle').length) {
$this.append('<i class="fa fa-angle-down pointer toggle"></i>');
}
}); });
} }

Loading…
Cancel
Save