From 2ee63a6a8314be8422695c9da84729eb79e21f7a Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 2 Feb 2021 15:47:10 -0500 Subject: [PATCH] DEV: Update icon structure in bootbox buttons (#11925) --- .../admin/addon/controllers/admin-user-index.js | 15 ++++++--------- .../app/controllers/preferences/second-factor.js | 3 ++- vendor/assets/javascripts/bootbox.js | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/admin/addon/controllers/admin-user-index.js b/app/assets/javascripts/admin/addon/controllers/admin-user-index.js index 49e0da0d459..cfc0cd8c880 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-user-index.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-user-index.js @@ -315,9 +315,8 @@ export default Controller.extend(CanCheckEmails, { link: true, }, { - label: - `${iconHTML("exclamation-triangle")} ` + - I18n.t("admin.user.delete_all_posts"), + icon: iconHTML("exclamation-triangle"), + label: I18n.t("admin.user.delete_all_posts"), class: "btn btn-danger", callback: () => { const progressModal = openProgressModal(); @@ -367,10 +366,9 @@ export default Controller.extend(CanCheckEmails, { link: true, }, { - label: - `${iconHTML("exclamation-triangle")} ` + - I18n.t("admin.user.anonymize_yes"), + label: I18n.t("admin.user.anonymize_yes"), class: "btn btn-danger", + icon: iconHTML("exclamation-triangle"), callback: () => { performAnonymize(); }, @@ -435,9 +433,8 @@ export default Controller.extend(CanCheckEmails, { link: true, }, { - label: - `${iconHTML("exclamation-triangle")} ` + - I18n.t("admin.user.delete_and_block"), + icon: iconHTML("exclamation-triangle"), + label: I18n.t("admin.user.delete_and_block"), class: "btn btn-danger", callback: () => { performDestroy(true); diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.js b/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.js index 566c704a600..946903a5684 100644 --- a/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.js +++ b/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.js @@ -131,7 +131,8 @@ export default Controller.extend(CanCheckEmails, { link: true, }, { - label: `${iconHTML("ban")}${I18n.t("user.second_factor.disable")}`, + icon: iconHTML("ban"), + label: I18n.t("user.second_factor.disable"), class: "btn-danger btn-icon-text", callback: () => { this.model diff --git a/vendor/assets/javascripts/bootbox.js b/vendor/assets/javascripts/bootbox.js index e84a733caef..fd40e3d8fd5 100644 --- a/vendor/assets/javascripts/bootbox.js +++ b/vendor/assets/javascripts/bootbox.js @@ -340,7 +340,7 @@ var bootbox = window.bootbox || (function(document, $) { } if (handlers[i]['icon']) { - icon = " "; + icon = handlers[i]['icon']; } if (handlers[i]['href']) { @@ -350,7 +350,7 @@ var bootbox = window.bootbox || (function(document, $) { href = _defaultHref; } - buttons = buttons + ""+icon+""+label+""; + buttons = buttons + ""+icon+""+label+""; callbacks[i] = callback; }