mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-03 22:30:58 +01:00
fix accidental client-side invocation of post history controls if it was disabled via ACP
This commit is contained in:
@@ -4,6 +4,10 @@ define('forum/topic/diffs', ['forum/topic/images', 'benchpress', 'translator'],
|
||||
var Diffs = {};
|
||||
|
||||
Diffs.open = function (pid) {
|
||||
if (!config.enablePostHistory) {
|
||||
return;
|
||||
}
|
||||
|
||||
var localeStringOpts = { year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' };
|
||||
|
||||
socket.emit('posts.getDiffs', { pid: pid }, function (err, timestamps) {
|
||||
@@ -49,6 +53,10 @@ define('forum/topic/diffs', ['forum/topic/images', 'benchpress', 'translator'],
|
||||
};
|
||||
|
||||
Diffs.load = function (pid, since, postContainer) {
|
||||
if (!config.enablePostHistory) {
|
||||
return;
|
||||
}
|
||||
|
||||
socket.emit('posts.showPostAt', { pid: pid, since: since }, function (err, data) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -140,10 +140,12 @@ define('forum/topic/postTools', [
|
||||
}
|
||||
});
|
||||
|
||||
postContainer.on('click', '[component="post/view-history"], [component="post/edit-indicator"]', function () {
|
||||
var btn = $(this);
|
||||
diffs.open(getData(btn, 'data-pid'));
|
||||
});
|
||||
if (config.enablePostHistory) {
|
||||
postContainer.on('click', '[component="post/view-history"], [component="post/edit-indicator"]', function () {
|
||||
var btn = $(this);
|
||||
diffs.open(getData(btn, 'data-pid'));
|
||||
});
|
||||
}
|
||||
|
||||
postContainer.on('click', '[component="post/delete"]', function () {
|
||||
var btn = $(this);
|
||||
|
||||
Reference in New Issue
Block a user