From 84e32d73a357b3f51acda0fb99009cede764a2f9 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 3 Jul 2020 13:07:17 +0200 Subject: [PATCH] Add icon for buttons in the empty trash modal --- customize.dist/src/less2/include/forms.less | 5 ++++- www/common/common-interface.js | 5 ++++- www/common/drive-ui.js | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/customize.dist/src/less2/include/forms.less b/customize.dist/src/less2/include/forms.less index 92a0f375e..db3ad3fbd 100644 --- a/customize.dist/src/less2/include/forms.less +++ b/customize.dist/src/less2/include/forms.less @@ -99,9 +99,12 @@ cursor: pointer; border-radius: 0; - .fa { + .fa, .cptools { margin-right: 0.2em; } + .cptools { + vertical-align: middle; + } color: @alertify-btn-fg; border: 1px solid @alertify-btn-fg; diff --git a/www/common/common-interface.js b/www/common/common-interface.js index d406eccaf..37ef044ff 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -395,7 +395,10 @@ define([ var navs = []; buttons.forEach(function (b) { 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'); var todo = function () { var noClose = b.onClick(); diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 2b0522a2f..f829409dd 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -2410,7 +2410,8 @@ define([ }]; if (hasOwned) { buttons.push({ - className: 'secondary', + className: 'danger', + iconClass: '.cptools.cptools-destroy', name: Messages.fc_delete_owned, onClick: function () { manager.emptyTrash(true, refresh); @@ -2421,6 +2422,7 @@ define([ buttons.push({ className: 'primary', // We may want to use a new key here + iconClass: '.fa.fa-trash', name: hasOwned ? Messages.fc_remove : Messages.okButton, onClick: function () { manager.emptyTrash(false, refresh);