Fix issues with trim history button

This commit is contained in:
yflory
2020-02-24 11:28:20 +01:00
parent 6f742fc295
commit 59d23ef5ff
4 changed files with 50 additions and 50 deletions

View File

@@ -1258,27 +1258,24 @@ define([
return;
}
$(currentSize).html(Messages._getKey('trimHistory_currentSize', [UIElements.prettySize(size)]));
$button.click(function () {
UI.confirmButton(button, {
classes: 'btn-danger'
}, function (yes) {
if (!yes) { return; }
$button.remove();
spinner.spin();
APP.history.execCommand('TRIM_HISTORY', {
channels: channels
}, function (obj) {
if (obj && obj.error) {
var error = h('div.alert.alert-danger', Messages.trimHistory_error);
$(content).empty().append(error);
return;
}
spinner.hide();
redrawTrimHistory(cb, $div);
});
$button.prop('disabled', '');
UI.confirmButton(button, {
classes: 'btn-danger'
}, function () {
$button.remove();
spinner.spin();
APP.history.execCommand('TRIM_HISTORY', {
channels: channels
}, function (obj) {
if (obj && obj.error) {
var error = h('div.alert.alert-danger', Messages.trimHistory_error);
$(content).empty().append(error);
return;
}
spinner.hide();
redrawTrimHistory(cb, $div);
});
}).prop('disabled', '');
});
});
$div.find('#cp-settings-trim-container').remove();