From b13c5655375216f05681fd08e608fd1734b4b1e7 Mon Sep 17 00:00:00 2001 From: Darren Date: Tue, 2 Oct 2012 17:56:42 +0100 Subject: [PATCH] Not submitting serverselection form if already in progress --- client_backbone/dev/view.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client_backbone/dev/view.js b/client_backbone/dev/view.js index 277eebb..0875285 100755 --- a/client_backbone/dev/view.js +++ b/client_backbone/dev/view.js @@ -108,6 +108,8 @@ kiwi.view.ServerSelect = function () { kiwi.gateway.bind('connecting', this.networkConnecting, this); kiwi.gateway.bind('onirc_error', function (data) { + $('button', this.$el).attr('disabled', null); + if (data.error == 'nickname_in_use') { this.setStatus('Nickname already taken'); this.show('nick_change'); @@ -122,10 +124,14 @@ kiwi.view.ServerSelect = function () { this.submitLogin(event); } + $('button', this.$el).attr('disabled', 1); return false; }, submitLogin: function (event) { + // If submitting is disabled, don't do anything + if ($('button', this.$el).attr('disabled')) return; + var values = { nick: $('.nick', this.$el).val(), server: $('.server', this.$el).val(), @@ -213,6 +219,7 @@ kiwi.view.ServerSelect = function () { showError: function (event) { this.setStatus('Error connecting', 'error'); + $('button', this.$el).attr('disabled', null); this.show(); } }); -- 2.25.1