mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2026-10-25 15:05:25 +00:00
Autofocus GitHub import URL, submit with Enter
This commit is contained in:
1 parent
fd4a6f8401
commit
137de06e54
1 file changed
+4
@@ -94,6 +94,10 @@ export function _importProjectFromGithub(e) {
|
||||
var modal = $("#importGithubModal");
|
||||
var btn = $("#importGithubButton");
|
||||
modal.modal('show');
|
||||
modal.off('shown.bs.modal').on('shown.bs.modal', () => $("#importGithubURL").trigger('focus'));
|
||||
$("#importGithubURL").off('keydown').on('keydown', (e) => {
|
||||
if (e.key === 'Enter') { e.preventDefault(); btn.trigger('click'); }
|
||||
});
|
||||
btn.off('click').on('click', () => {
|
||||
var githuburl = $("#importGithubURL").val() + "";
|
||||
modal.modal('hide');
|
||||
|
||||
Reference in new issue
Block a user