mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-26 17:55:24 +03:00
show successful clipboard copy on the button
This commit is contained in:
parent
4968f7b080
commit
e7798344d8
2 changed files with 16 additions and 2 deletions
|
@ -2260,7 +2260,7 @@
|
||||||
"message": "Copy to clipboard"
|
"message": "Copy to clipboard"
|
||||||
},
|
},
|
||||||
"cliCopySuccessful": {
|
"cliCopySuccessful": {
|
||||||
"message": "Content has been copied to clipboard!"
|
"message": "Copied!"
|
||||||
},
|
},
|
||||||
|
|
||||||
"loggingNote": {
|
"loggingNote": {
|
||||||
|
|
|
@ -43,7 +43,21 @@ function getCliCommand(command, cliBuffer) {
|
||||||
|
|
||||||
function copyToClipboard(text, nwGui) {
|
function copyToClipboard(text, nwGui) {
|
||||||
function onCopySuccessful() {
|
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) {
|
function onCopyFailed(ex) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue