Add icon for buttons in the empty trash modal

pull/1/head
yflory 4 years ago
parent dfd50d103d
commit 84e32d73a3

@ -99,9 +99,12 @@
cursor: pointer; cursor: pointer;
border-radius: 0; border-radius: 0;
.fa { .fa, .cptools {
margin-right: 0.2em; margin-right: 0.2em;
} }
.cptools {
vertical-align: middle;
}
color: @alertify-btn-fg; color: @alertify-btn-fg;
border: 1px solid @alertify-btn-fg; border: 1px solid @alertify-btn-fg;

@ -395,7 +395,10 @@ define([
var navs = []; var navs = [];
buttons.forEach(function (b) { buttons.forEach(function (b) {
if (!b.name || !b.onClick) { return; } if (!b.name || !b.onClick) { return; }
var button = h('button', { tabindex: '1', 'class': b.className || '' }, b.name); var button = h('button', { tabindex: '1', 'class': b.className || '' }, [
b.iconClass ? h('i' + b.iconClass) : undefined,
b.name
]);
button.classList.add('btn'); button.classList.add('btn');
var todo = function () { var todo = function () {
var noClose = b.onClick(); var noClose = b.onClick();

@ -2410,7 +2410,8 @@ define([
}]; }];
if (hasOwned) { if (hasOwned) {
buttons.push({ buttons.push({
className: 'secondary', className: 'danger',
iconClass: '.cptools.cptools-destroy',
name: Messages.fc_delete_owned, name: Messages.fc_delete_owned,
onClick: function () { onClick: function () {
manager.emptyTrash(true, refresh); manager.emptyTrash(true, refresh);
@ -2421,6 +2422,7 @@ define([
buttons.push({ buttons.push({
className: 'primary', className: 'primary',
// We may want to use a new key here // We may want to use a new key here
iconClass: '.fa.fa-trash',
name: hasOwned ? Messages.fc_remove : Messages.okButton, name: hasOwned ? Messages.fc_remove : Messages.okButton,
onClick: function () { onClick: function () {
manager.emptyTrash(false, refresh); manager.emptyTrash(false, refresh);

Loading…
Cancel
Save