1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Ensure library list has an item selected when opened

This commit is contained in:
Nick O'Leary 2019-05-28 11:23:03 +01:00
parent ed033565a4
commit d360f30af6
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 13 additions and 6 deletions

View File

@ -676,7 +676,8 @@ RED.clipboard = (function() {
done(children);
})
}
}]);
}], true);
}
function hideDropTarget() {

View File

@ -384,7 +384,11 @@
})
return res;
}
return s.parent().data('data');
if (s.length) {
return s.parent().data('data');
} else {
return undefined;
}
}
});

View File

@ -431,11 +431,13 @@ RED.library = (function() {
focus: function() {
dirList.focus();
},
data: function(content) {
data: function(content,selectFirst) {
dirList.treeList('data',content);
// setTimeout(function() {
// dirList.treeList('select',content[0]);
// },100);
if (selectFirst) {
setTimeout(function() {
dirList.treeList('select',content[0]);
},100);
}
}
}
}