From: Jack Allnutt Date: Sun, 23 Sep 2012 23:08:41 +0000 (+0100) Subject: Merge branch 'backbone_ui' of github.com:prawnsalad/KiwiIRC into backbone_ui X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=39b10c31a8b65dedf68d5d3cba1bd042cee4982f;p=KiwiIRC.git Merge branch 'backbone_ui' of github.com:prawnsalad/KiwiIRC into backbone_ui Conflicts: client_backbone/css/style.css client_backbone/dev/model_application.js client_backbone/dev/view.js client_backbone/index.html --- 39b10c31a8b65dedf68d5d3cba1bd042cee4982f diff --cc client_backbone/dev/model_application.js index c9c5fd1,ba04fe0..7a1f88f --- a/client_backbone/dev/model_application.js +++ b/client_backbone/dev/model_application.js @@@ -495,8 -516,13 +516,13 @@@ kiwi.model.Application = function () kiwi.app.panels.server.addMsg(' ', '=== The nickname ' + data.nick + ' is already in use. Please select a new nickname', 'status'); if (kiwi.app.panels.server !== kiwi.app.panels.active) { kiwi.app.message.text('The nickname "' + data.nick + '" is already in use. Please select a new nickname'); - } ++ } + + // Only show the nickchange component if the controlbox is open + if (that.controlbox.$el.css('display') !== 'none') { + (new kiwi.view.NickChangeBox()).render(); } - (new kiwi.view.NickChangeBox()).render(); - ++ break; default: // We don't know what data contains, so don't do anything with it. @@@ -757,4 -786,7 +786,7 @@@ return (channel_prefix.indexOf(channel_name[0]) > -1); }; - })()); + + + return new (Backbone.Model.extend(this))(arguments); -}; ++}; diff --cc client_backbone/dev/view.js index 1940fe6,b0773b6..6a77777 --- a/client_backbone/dev/view.js +++ b/client_backbone/dev/view.js @@@ -59,9 -59,10 +59,10 @@@ kiwi.view.UserBox = Backbone.View.exten } }); --kiwi.view.NickChangeBox = Backbone.View.extend({ ++kiwi.view.NickChangeBox = Backbone.View.extend({ events: { - 'click .btn_nickchange': 'changeNick' + 'submit': 'changeNick', + 'click .cancel': 'close' }, initialize: function () { @@@ -542,8 -595,8 +595,8 @@@ kiwi.view.ControlBox = Backbone.View.ex // Instance of InputPreProcessor preprocessor: null, -- events: { - 'keydown input': 'process', - 'keydown input.inp': 'process', ++ events: { ++ 'keydown input.inp': 'process', 'click .nick': 'showNickChange' },