mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
fix: add dropup handler to thread tools menu, updated how post tools menu adds dropup handler
This commit is contained in:
@@ -177,6 +177,12 @@ define('forum/topic', [
|
|||||||
Topic.applyDropup.call(this);
|
Topic.applyDropup.call(this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
hooks.onPage('action:topic.tools.load', ({ element }) => {
|
||||||
|
Topic.applyDropup.call(element.get(0).parentNode);
|
||||||
|
});
|
||||||
|
hooks.onPage('action:post.tools.load', ({ element }) => {
|
||||||
|
Topic.applyDropup.call(element.get(0).parentNode);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function addRepliesHandler() {
|
function addRepliesHandler() {
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ define('forum/topic/postTools', [
|
|||||||
|
|
||||||
function renderMenu() {
|
function renderMenu() {
|
||||||
$('[component="topic"]').on('show.bs.dropdown', '.moderator-tools', function () {
|
$('[component="topic"]').on('show.bs.dropdown', '.moderator-tools', function () {
|
||||||
const self = this;
|
|
||||||
const $this = $(this);
|
const $this = $(this);
|
||||||
const dropdownMenu = $this.find('.dropdown-menu');
|
const dropdownMenu = $this.find('.dropdown-menu');
|
||||||
if (dropdownMenu.html()) {
|
if (dropdownMenu.html()) {
|
||||||
@@ -50,15 +49,14 @@ define('forum/topic/postTools', [
|
|||||||
|
|
||||||
const html = await app.parseAndTranslate('partials/topic/post-menu-list', data);
|
const html = await app.parseAndTranslate('partials/topic/post-menu-list', data);
|
||||||
const clipboard = require('clipboard');
|
const clipboard = require('clipboard');
|
||||||
// eslint-disable-next-line import/no-unresolved
|
|
||||||
const topic = require('forum/topic');
|
|
||||||
|
|
||||||
dropdownMenu.html(html);
|
dropdownMenu.html(html);
|
||||||
dropdownMenu.get(0).classList.toggle('hidden', false);
|
dropdownMenu.get(0).classList.toggle('hidden', false);
|
||||||
topic.applyDropup.call(self);
|
|
||||||
new clipboard('[data-clipboard-text]');
|
new clipboard('[data-clipboard-text]');
|
||||||
|
|
||||||
hooks.fire('action:post.tools.load');
|
hooks.fire('action:post.tools.load', {
|
||||||
|
element: dropdownMenu,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user