New UI tool: confirm button

This commit is contained in:
yflory
2020-02-04 14:49:31 +01:00
parent 689ea40a92
commit 2e631a8b5f
3 changed files with 74 additions and 2 deletions

View File

@@ -1208,7 +1208,7 @@ define([
var spinner = UI.makeSpinner();
var button = h('button.btn.btn-danger-alt', {
disabled: 'disabled'
}, Messages.trimHistory_button || 'test'); // XXX
}, Messages.trimHistory_button || 'delete history... xxx'); // XXX
var currentSize = h('p', $(spinner.spinner).clone()[0]);
var content = h('div', [
currentSize,
@@ -1238,7 +1238,10 @@ define([
}).nThen(function () {
$(currentSize).html(Messages._getKey('trimHistory_currentSize', [size]));
$button.click(function () {
UI.confirm(Messages.trimHistory_confirm, function (yes) {
//UI.confirm(Messages.trimHistory_confirm, function (yes) {
UI.confirmButton(button, {
classes: 'btn-danger'
}, function (yes) {
if (!yes) { return; }
$button.remove();