Merge pull request #2104 from cryptpad/oo_disable_history

Hide History button if history disabled
This commit is contained in:
yflory 2026-01-09 16:44:04 +01:00 committed by GitHub
commit d58c996d49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -896,10 +896,6 @@ define([
button = makeButton('print', 'cp-toolbar-icon-print', Messages.printButtonTitle2, Messages.printText);
break;
case 'history':
if (!AppConfig.enableHistory) {
button = $('<span>');
break;
}
button = makeButton('history', 'cp-toolbar-icon-history', Messages.historyButton, Messages.historyText, Messages.historyButton);
if (data.histConfig) {
button.click(common.prepareFeedback(type)).on('click', function () {
@ -907,6 +903,9 @@ define([
UI.clearTooltipsDelay();
});
}
if (!AppConfig.enableHistory) {
button.css('display', 'none');
}
break;
case 'mediatag':
button = $(h('button.cp-toolbar-mediatag', {

View File

@ -15,6 +15,7 @@ define([
'/common/common-feedback.js',
'/common/hyperscript.js',
'/api/config',
'/customize/application_config.js',
'/customize/messages.js',
'/components/chainpad/chainpad.dist.js',
'/file/file-crypto.js',
@ -44,6 +45,7 @@ define([
Feedback,
h,
ApiConfig,
AppConfig,
Messages,
ChainPad,
FileCrypto,
@ -3220,6 +3222,9 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
text: Messages.historyText,
tippy: Messages.historyButton
});
if (!AppConfig.enableHistory) {
$historyButton.css('display', 'none');
}
$historyButton.click(function () {
ooChannel.historyLastHash = ooChannel.lastHash;