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:
parent
4968f7b080
commit
e7798344d8
2 changed files with 16 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue