exposing pid, username, and userslug to flag modal

v1.18.x
Julian Lam 8 years ago
parent afc182478b
commit 8159c44df2

@ -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);
});
});

Loading…
Cancel
Save