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) {