mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-04 12:18:28 +02:00
exposing pid, username, and userslug to flag modal
This commit is contained in:
@@ -62,8 +62,8 @@
|
||||
"nodebb-plugin-spam-be-gone": "0.4.10",
|
||||
"nodebb-rewards-essentials": "0.0.9",
|
||||
"nodebb-theme-lavender": "3.0.15",
|
||||
"nodebb-theme-persona": "4.1.66",
|
||||
"nodebb-theme-vanilla": "5.1.44",
|
||||
"nodebb-theme-persona": "4.1.67",
|
||||
"nodebb-theme-vanilla": "5.1.45",
|
||||
"nodebb-widget-essentials": "2.0.12",
|
||||
"nodemailer": "2.6.4",
|
||||
"nodemailer-sendmail-transport": "1.0.0",
|
||||
|
||||
@@ -8,8 +8,12 @@ define('forum/topic/flag', [], function () {
|
||||
flagModal,
|
||||
flagCommit;
|
||||
|
||||
Flag.showFlagModal = function (pid) {
|
||||
parseModal(function (html) {
|
||||
Flag.showFlagModal = function (pid, username, userslug) {
|
||||
parseModal({
|
||||
pid: pid,
|
||||
username: username,
|
||||
userslug: userslug
|
||||
}, function (html) {
|
||||
flagModal = $(html);
|
||||
|
||||
flagModal.on('hidden.bs.modal', function () {
|
||||
@@ -32,8 +36,8 @@ define('forum/topic/flag', [], function () {
|
||||
});
|
||||
};
|
||||
|
||||
function parseModal(callback) {
|
||||
templates.parse('partials/modals/flag_post_modal', {}, function (html) {
|
||||
function parseModal(tplData, callback) {
|
||||
templates.parse('partials/modals/flag_post_modal', tplData, function (html) {
|
||||
require(['translator'], function (translator) {
|
||||
translator.translate(html, callback);
|
||||
});
|
||||
|
||||
@@ -167,8 +167,10 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
||||
|
||||
postContainer.on('click', '[component="post/flag"]', function () {
|
||||
var pid = getData($(this), 'data-pid');
|
||||
var username = getData($(this), 'data-username');
|
||||
var userslug = getData($(this), 'data-userslug');
|
||||
require(['forum/topic/flag'], function (flag) {
|
||||
flag.showFlagModal(pid);
|
||||
flag.showFlagModal(pid, username, userslug);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user