mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 10:46:14 +01:00
fix: chat ip button not doing anything if clicked outside of icon
This commit is contained in:
@@ -100,10 +100,10 @@
|
|||||||
"nodebb-plugin-ntfy": "1.0.15",
|
"nodebb-plugin-ntfy": "1.0.15",
|
||||||
"nodebb-plugin-spam-be-gone": "2.0.7",
|
"nodebb-plugin-spam-be-gone": "2.0.7",
|
||||||
"nodebb-rewards-essentials": "0.2.3",
|
"nodebb-rewards-essentials": "0.2.3",
|
||||||
"nodebb-theme-harmony": "1.0.18",
|
"nodebb-theme-harmony": "1.0.19",
|
||||||
"nodebb-theme-lavender": "7.0.9",
|
"nodebb-theme-lavender": "7.0.9",
|
||||||
"nodebb-theme-peace": "2.0.21",
|
"nodebb-theme-peace": "2.0.22",
|
||||||
"nodebb-theme-persona": "13.0.63",
|
"nodebb-theme-persona": "13.0.64",
|
||||||
"nodebb-widget-essentials": "7.0.12",
|
"nodebb-widget-essentials": "7.0.12",
|
||||||
"nodemailer": "6.9.1",
|
"nodemailer": "6.9.1",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
|
|||||||
@@ -103,20 +103,18 @@ define('forum/chats', [
|
|||||||
};
|
};
|
||||||
|
|
||||||
Chats.addIPHandler = function (container) {
|
Chats.addIPHandler = function (container) {
|
||||||
container.on('click', '.chat-ip-button', function () {
|
container.on('click', '.chat-ip-button', async function () {
|
||||||
const ipEl = $(this).parent();
|
const ipEl = $(this);
|
||||||
const mid = ipEl.parents('[data-mid]').attr('data-mid');
|
let ip = ipEl.attr('data-ip');
|
||||||
socket.emit('modules.chats.getIP', mid, function (err, ip) {
|
if (ip) {
|
||||||
if (err) {
|
|
||||||
return alerts.error(err);
|
|
||||||
}
|
|
||||||
ipEl.text(ip);
|
|
||||||
ipEl.on('click', () => {
|
|
||||||
navigator.clipboard.writeText(ip);
|
navigator.clipboard.writeText(ip);
|
||||||
ipEl.translateText('[[global:copied]]');
|
ipEl.translateText('[[global:copied]]');
|
||||||
setTimeout(() => ipEl.text(ip), 2000);
|
setTimeout(() => ipEl.text(ip), 2000);
|
||||||
});
|
return;
|
||||||
});
|
}
|
||||||
|
const mid = ipEl.parents('[data-mid]').attr('data-mid');
|
||||||
|
ip = await socket.emit('modules.chats.getIP', mid);
|
||||||
|
ipEl.text(ip).attr('data-ip', ip);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user