mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-16 21:40:23 +01:00
collapsible blockquotes, closes #1359
This commit is contained in:
@@ -47,6 +47,8 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools',
|
||||
|
||||
enableInfiniteLoading();
|
||||
|
||||
addBlockquoteEllipses($('.topic .post-content > blockquote'));
|
||||
|
||||
var bookmark = localStorage.getItem('topic:' + tid + ':bookmark');
|
||||
if (window.location.hash) {
|
||||
Topic.scrollToPost(window.location.hash.substr(1), true);
|
||||
@@ -101,6 +103,19 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools',
|
||||
createNewPosts(data);
|
||||
}
|
||||
|
||||
function addBlockquoteEllipses(blockquotes) {
|
||||
blockquotes.each(function() {
|
||||
var $this = $(this);
|
||||
if ($this.find(':hidden').length) {
|
||||
$this.append('<i class="fa fa-ellipsis-h pointer toggle"></i>');
|
||||
}
|
||||
});
|
||||
|
||||
$('blockquote .toggle').on('click', function() {
|
||||
$(this).parent('blockquote').toggleClass('uncollapsed');
|
||||
});
|
||||
}
|
||||
|
||||
function enableInfiniteLoading() {
|
||||
if(!config.usePagination) {
|
||||
|
||||
@@ -291,8 +306,12 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools',
|
||||
var firstPid = parseInt(data.posts[0].pid, 10);
|
||||
|
||||
$('#post-container li[data-pid]').each(function() {
|
||||
if(firstPid > parseInt($(this).attr('data-pid'), 10)) {
|
||||
after = $(this);
|
||||
var $this = $(this);
|
||||
|
||||
addBlockquoteEllipses($this.find('.post-content > blockquote'));
|
||||
|
||||
if(firstPid > parseInt($this.attr('data-pid'), 10)) {
|
||||
after = $this;
|
||||
if(after.next().length && after.next().hasClass('post-bar')) {
|
||||
after = after.next();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user