mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Better interaction with view-ssh-key list
This commit is contained in:
parent
757e72100d
commit
1337831061
@ -264,14 +264,19 @@ RED.projects.userSettings = (function() {
|
||||
utils.sendRequest(options);
|
||||
|
||||
var formButtons = $('<span class="button-row" style="position: relative; float: right; margin: 10px;"></span>').appendTo(row);
|
||||
$('<button class="editor-button editor-button-small">Copy to clipboard</button>')
|
||||
$('<button class="editor-button editor-button-small">Copy public key to clipboard</button>')
|
||||
.appendTo(formButtons)
|
||||
.click(function(evt) {
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
document.getSelection().selectAllChildren(keyBox[0]);
|
||||
var ret = document.execCommand('copy');
|
||||
document.getSelection().empty();
|
||||
try {
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
document.getSelection().selectAllChildren(keyBox[0]);
|
||||
var ret = document.execCommand('copy');
|
||||
document.getSelection().empty();
|
||||
} catch(err) {
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return row;
|
||||
@ -282,22 +287,17 @@ RED.projects.userSettings = (function() {
|
||||
scrollOnAdd: false,
|
||||
addItem: function(row,index,entry) {
|
||||
var container = $('<div class="projects-dialog-list-entry">').appendTo(row);
|
||||
|
||||
if (entry.empty) {
|
||||
container.addClass('red-ui-search-empty');
|
||||
container.text("No SSH keys");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$('<span class="entry-icon"><i class="fa fa-key"></i></span>').appendTo(container);
|
||||
var content = $('<span>').appendTo(container);
|
||||
var topRow = $('<div>').appendTo(content);
|
||||
var topRow = $('<div class="projects-dialog-ssh-key-header">').appendTo(container);
|
||||
$('<span class="entry-icon"><i class="fa fa-key"></i></span>').appendTo(topRow);
|
||||
$('<span class="entry-name">').text(entry.name).appendTo(topRow);
|
||||
|
||||
var tools = $('<span class="button-row entry-tools">').appendTo(container);
|
||||
var tools = $('<span class="button-row entry-tools">').appendTo(topRow);
|
||||
var expandedRow;
|
||||
row.click(function(e) {
|
||||
topRow.click(function(e) {
|
||||
if (expandedRow) {
|
||||
expandedRow.slideUp(200,function() {
|
||||
expandedRow.remove();
|
||||
|
@ -790,10 +790,14 @@ div.projects-dialog-ssh-public-key {
|
||||
|
||||
.projects-dialog-ssh-key-list {
|
||||
li {
|
||||
cursor: pointer;
|
||||
padding: 0 !important;
|
||||
}
|
||||
li:hover {
|
||||
background: #f3f3f3;
|
||||
.projects-dialog-ssh-key-header {
|
||||
padding: 10px 5px;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background: #f3f3f3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user