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); done(children);
}) })
} }
}]); }], true);
} }
function hideDropTarget() { function hideDropTarget() {

View File

@ -384,7 +384,11 @@
}) })
return res; 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() { focus: function() {
dirList.focus(); dirList.focus();
}, },
data: function(content) { data: function(content,selectFirst) {
dirList.treeList('data',content); dirList.treeList('data',content);
// setTimeout(function() { if (selectFirst) {
// dirList.treeList('select',content[0]); setTimeout(function() {
// },100); dirList.treeList('select',content[0]);
},100);
}
} }
} }
} }