Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 25d49a8

Browse files
committed
autofocusing name input on the server configs form
1 parent edd2f8f commit 25d49a8

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

js/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ launchOnboarding = function(guidCreating) {
425425

426426
pageConnectModal.on('cancel', () => {
427427
removeStartupRetry();
428-
app.getHeartbeatSocket().cancel();
428+
app.getHeartbeatSocket()._socket.onclose = null;
429+
app.getHeartbeatSocket().close();
429430
pageConnectModal.remove();
430431
app.serverConnectModal.open();
431432
}).render().open();

js/utils/Socket.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,6 @@ Socket.prototype.send = function() {
5757
this._socket.send.apply(this._socket, arguments);
5858
};
5959

60-
Socket.prototype.cancel = function() {
61-
// this will not result in a 'close' event
62-
// todo: perhaps we should fire a 'cancel' event?
63-
if (this._socket) {
64-
this._socket.onopen = null;
65-
this._socket.onclose = null;
66-
this._socket.onerror = null;
67-
this._socket.onmessage = null;
68-
this._socket.close();
69-
}
70-
};
71-
7260
Socket.prototype.getReadyState = function() {
7361
return this._socket.readyState;
7462
};

js/views/serverConnectModal.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ module.exports = BaseModal.extend({
9898
this.connect(md);
9999
});
100100

101-
this.$jsConfigFormWrap.removeClass('slide-out');
101+
this.$jsConfigFormWrap.one('transitionend', () => {
102+
this.serverConfigFormVw.$('input[name="name"]').focus();
103+
}).removeClass('slide-out');
102104
},
103105

104106
newConfigForm: function() {

0 commit comments

Comments
 (0)