From 729a9856f87d01b24817be3dea330538e18c1e3e Mon Sep 17 00:00:00 2001 From: Kris Date: Mon, 12 Jul 2021 14:34:08 -0400 Subject: [PATCH] UX: Add copy button to theme public key (#13690) --- .../addon/templates/modal/admin-install-theme.hbs | 5 ++++- app/assets/stylesheets/common/admin/customize.scss | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/addon/templates/modal/admin-install-theme.hbs b/app/assets/javascripts/admin/addon/templates/modal/admin-install-theme.hbs index 78baeab2e6a..fcc7d7ca2ae 100644 --- a/app/assets/javascripts/admin/addon/templates/modal/admin-install-theme.hbs +++ b/app/assets/javascripts/admin/addon/templates/modal/admin-install-theme.hbs @@ -78,7 +78,10 @@ {{#if showPublicKey}}
{{i18n "admin.customize.theme.public_key"}}
- {{textarea readonly=true value=publicKey}} +
+ {{textarea class="public-key-value" readonly=true value=publicKey}} + {{copy-button selector="textarea.public-key-value"}} +
{{else}} {{#if privateChecked}} diff --git a/app/assets/stylesheets/common/admin/customize.scss b/app/assets/stylesheets/common/admin/customize.scss index 47a5e43d7c6..045235d3c17 100644 --- a/app/assets/stylesheets/common/admin/customize.scss +++ b/app/assets/stylesheets/common/admin/customize.scss @@ -596,7 +596,6 @@ } label input { width: auto; - margin: 3px 0; } } .public-key { @@ -604,7 +603,17 @@ textarea { cursor: auto; min-height: 220px; + margin-bottom: 0; } + button { + position: absolute; + top: 0; + right: 0; + } +} + +.public-key-text-wrapper { + position: relative; } .public-key-note {