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-plugin-spam-be-gone": "0.4.10",
"nodebb-rewards-essentials": "0.0.9", "nodebb-rewards-essentials": "0.0.9",
"nodebb-theme-lavender": "3.0.15", "nodebb-theme-lavender": "3.0.15",
"nodebb-theme-persona": "4.1.66", "nodebb-theme-persona": "4.1.67",
"nodebb-theme-vanilla": "5.1.44", "nodebb-theme-vanilla": "5.1.45",
"nodebb-widget-essentials": "2.0.12", "nodebb-widget-essentials": "2.0.12",
"nodemailer": "2.6.4", "nodemailer": "2.6.4",
"nodemailer-sendmail-transport": "1.0.0", "nodemailer-sendmail-transport": "1.0.0",

@ -8,8 +8,12 @@ define('forum/topic/flag', [], function () {
flagModal, flagModal,
flagCommit; flagCommit;
Flag.showFlagModal = function (pid) { Flag.showFlagModal = function (pid, username, userslug) {
parseModal(function (html) { parseModal({
pid: pid,
username: username,
userslug: userslug
}, function (html) {
flagModal = $(html); flagModal = $(html);
flagModal.on('hidden.bs.modal', function () { flagModal.on('hidden.bs.modal', function () {
@ -32,8 +36,8 @@ define('forum/topic/flag', [], function () {
}); });
}; };
function parseModal(callback) { function parseModal(tplData, callback) {
templates.parse('partials/modals/flag_post_modal', {}, function (html) { templates.parse('partials/modals/flag_post_modal', tplData, function (html) {
require(['translator'], function (translator) { require(['translator'], function (translator) {
translator.translate(html, callback); translator.translate(html, callback);
}); });

@ -167,8 +167,10 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
postContainer.on('click', '[component="post/flag"]', function () { postContainer.on('click', '[component="post/flag"]', function () {
var pid = getData($(this), 'data-pid'); var pid = getData($(this), 'data-pid');
var username = getData($(this), 'data-username');
var userslug = getData($(this), 'data-userslug');
require(['forum/topic/flag'], function (flag) { require(['forum/topic/flag'], function (flag) {
flag.showFlagModal(pid); flag.showFlagModal(pid, username, userslug);
}); });
}); });

Loading…
Cancel
Save