show successful clipboard copy on the button

10.5.x-maintenance
Károly Kiripolszky 2019-03-25 11:10:57 +01:00
parent 4968f7b080
commit e7798344d8
2 changed files with 16 additions and 2 deletions

View File

@ -2260,7 +2260,7 @@
"message": "Copy to clipboard"
},
"cliCopySuccessful": {
"message": "Content has been copied to clipboard!"
"message": "Copied!"
},
"loggingNote": {

View File

@ -43,7 +43,21 @@ function getCliCommand(command, cliBuffer) {
function copyToClipboard(text, nwGui) {
function onCopySuccessful() {
writeLineToOutput("* " + i18n.getMessage("cliCopySuccessful"));
const button = $('.tab-cli .copy');
const origText = button.text();
const origWidth = button.css("width");
button.text(i18n.getMessage("cliCopySuccessful"));
button.css({
width: origWidth,
textAlign: "center",
});
setTimeout(() => {
button.text(origText);
button.css({
width: "",
textAlign: "",
});
}, 1500);
}
function onCopyFailed(ex) {