1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-26 01:35:28 +03:00

show successful clipboard copy on the button

This commit is contained in:
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

@ -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) {