mirror of
https://github.com/scratchfoundation/scratchx.git
synced 2025-02-17 19:30:20 -05:00
Use a form for URLs so you can hit enter to submit
This commit is contained in:
parent
227bda3d10
commit
4fbe39264b
2 changed files with 6 additions and 5 deletions
|
@ -52,10 +52,10 @@
|
|||
<p><a href="">What is a ScratchX URL?</a></p>
|
||||
</section>
|
||||
<section>
|
||||
<div class="input-plus-button" data-action="load-url">
|
||||
<form class="input-plus-button" data-action="load-url">
|
||||
<input type="text" placeholder="paste url..." />
|
||||
<button>Open</button>
|
||||
</div>
|
||||
<button type="submit">Open</button>
|
||||
</form>
|
||||
</section>
|
||||
</dialog>
|
||||
|
||||
|
|
|
@ -140,8 +140,9 @@ function sendURLtoFlash(url) {
|
|||
}
|
||||
}
|
||||
|
||||
$("[data-action='load-url'] button").click(function(e) {
|
||||
sendURLtoFlash($(e.target).siblings('input[type="text"]').val());
|
||||
$("[data-action='load-url']").submit(function(e) {
|
||||
e.preventDefault();
|
||||
sendURLtoFlash($('input[type="text"]', this).val());
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue