mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #3331 from kazuhitoyokoi/master-fixcopybutton2
Fix copy buttons on the debug window (another method)
This commit is contained in:
commit
1e5ed2a2e3
@ -946,9 +946,8 @@ RED.clipboard = (function() {
|
||||
if (truncated) {
|
||||
msg += "_truncated";
|
||||
}
|
||||
$("#red-ui-clipboard-hidden").val(value).focus().select();
|
||||
var result = document.execCommand("copy");
|
||||
if (result && element) {
|
||||
navigator.clipboard.writeText(value).then(function () {
|
||||
if (element) {
|
||||
var popover = RED.popover.create({
|
||||
target: element,
|
||||
direction: 'left',
|
||||
@ -960,14 +959,12 @@ RED.clipboard = (function() {
|
||||
},1000);
|
||||
popover.open();
|
||||
}
|
||||
$("#red-ui-clipboard-hidden").val("");
|
||||
if (currentFocus) {
|
||||
$(currentFocus).focus();
|
||||
}
|
||||
return result;
|
||||
}).catch(err => { console.error("Failed to copy:",err) });
|
||||
}
|
||||
|
||||
|
||||
function importNodes(nodesStr,addFlow) {
|
||||
var newNodes = nodesStr;
|
||||
if (typeof nodesStr === 'string') {
|
||||
@ -1242,8 +1239,6 @@ RED.clipboard = (function() {
|
||||
init: function() {
|
||||
setupDialogs();
|
||||
|
||||
$('<textarea type="text" id="red-ui-clipboard-hidden" tabIndex="-1">').appendTo("#red-ui-editor");
|
||||
|
||||
RED.actions.add("core:show-export-dialog",showExportNodes);
|
||||
RED.actions.add("core:show-import-dialog",showImportNodes);
|
||||
|
||||
|
@ -356,10 +356,6 @@ button.red-ui-button-small
|
||||
background: $secondary-background;
|
||||
}
|
||||
|
||||
#red-ui-clipboard-hidden {
|
||||
position: absolute;
|
||||
top: -3000px;
|
||||
}
|
||||
.form-row .red-ui-editor-node-label-form-row {
|
||||
margin: 5px 0 0 50px;
|
||||
label {
|
||||
|
Loading…
Reference in New Issue
Block a user