Choose device name screen: Finish by pressing enter (#2085)
This commit is contained in:
parent
40ee88ead3
commit
59bee6690d
3 changed files with 27 additions and 15 deletions
|
@ -23,7 +23,8 @@
|
|||
className: 'main full-screen-flow',
|
||||
events: {
|
||||
'click .try-again': 'connect',
|
||||
// handler for finish button is in confirmNumber()
|
||||
'click .finish': 'finishLinking',
|
||||
// the actual next step happens in confirmNumber() on submit form #link-phone
|
||||
},
|
||||
initialize: function(options) {
|
||||
options = options || {};
|
||||
|
@ -143,13 +144,17 @@
|
|||
this.$(DEVICE_NAME_SELECTOR).val(deviceName || window.config.hostname);
|
||||
this.$(DEVICE_NAME_SELECTOR).focus();
|
||||
},
|
||||
finishLinking: function() {
|
||||
// We use a form so we get submit-on-enter behavior
|
||||
this.$('#link-phone').submit();
|
||||
},
|
||||
confirmNumber: function(number) {
|
||||
window.removeSetupMenuItems();
|
||||
this.selectStep(Steps.ENTER_NAME);
|
||||
this.setDeviceNameDefault();
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
this.$('.finish').click(function(e) {
|
||||
this.$('#link-phone').submit(function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue