mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
This commit is contained in:
@@ -59,8 +59,8 @@ define('forum/topic', [
|
||||
}
|
||||
|
||||
addBlockQuoteHandler();
|
||||
|
||||
addParentHandler();
|
||||
addDropupHandler();
|
||||
|
||||
navigator.init('[component="post"]', ajaxify.data.postcount, Topic.toTop, Topic.toBottom, Topic.navigatorCallback, Topic.calculateIndex);
|
||||
|
||||
@@ -166,6 +166,17 @@ define('forum/topic', [
|
||||
});
|
||||
}
|
||||
|
||||
function addDropupHandler() {
|
||||
// Locate all dropdowns
|
||||
var target = $('#content .dropdown-menu').parent();
|
||||
|
||||
// Toggle dropup if past 50% of screen
|
||||
$(target).on('show.bs.dropdown', function () {
|
||||
var dropUp = this.getBoundingClientRect().top > ($(window).height() / 2);
|
||||
$(this).toggleClass('dropup', dropUp);
|
||||
});
|
||||
}
|
||||
|
||||
function updateTopicTitle() {
|
||||
var span = components.get('navbar/title').find('span');
|
||||
if ($(window).scrollTop() > 50 && span.hasClass('hidden')) {
|
||||
|
||||
Reference in New Issue
Block a user