Confirm device name with enter key

Use form and submit elements for their built in mouse and keyboard event
handlers.

// FREEBIE
This commit is contained in:
lilia 2017-02-06 20:10:40 -08:00
parent c9939c8da8
commit aa55b6a538
2 changed files with 7 additions and 4 deletions

View file

@ -63,8 +63,9 @@
this.$('#step4 .cancel').click(function(e) {
reject();
});
this.$('#sync').click(function(e) {
this.$('#step4').submit(function(e) {
e.stopPropagation();
e.preventDefault();
var name = this.$('#device-name').val();
name = name.replace(/\0/g,''); // strip unicode null
if (name.trim().length === 0) {

View file

@ -42,7 +42,7 @@
</div>
</div>
<div id='step4' class='step'>
<form id='step4' class='step'>
<p>{{ installLinkingWithNumber }}</p>
<h2 class='number'></h2>
<img id='signal-computer' src='/images/signal-laptop.png'>
@ -51,9 +51,11 @@
<input type='text' id='device-name' spellcheck='false' maxlength='50' />
</div>
<div class='nav'>
<div> <a class='button' id='sync'>{{ installFinalButton }}</a> </div>
<div>
<input type='submit' class='button' id='sync' value='{{ installFinalButton }}' />
</div>
</div>
</div>
</form>
<div id='step5' class='step'>
<img id='signal-icon' src='/images/icon_250.png'/>