this.initializeClient();\r
this.view.barsHide(true);\r
\r
- this.panels.server.server_login.on('server_connect', function (event) {\r
- var form = this;\r
-\r
+ this.panels.server.server_login.bind('server_connect', function (event) {\r
auto_connect_details = event;\r
\r
kiwi.gateway.set('nick', event.nick);\r
/**\r
* Set the UI components up\r
*/\r
+ this.panels = new kiwi.model.PanelList();\r
+\r
this.controlbox = new kiwi.view.ControlBox({el: $('#controlbox')[0]});\r
this.bindControllboxCommands(this.controlbox);\r
\r
this.topicbar = new kiwi.view.TopicBar({el: $('#topic')[0]});\r
\r
- // Container for the channels\r
- this.panels = new kiwi.model.PanelList();\r
+ \r
this.panels.server.view.show();\r
\r
// Rejigg the UI sizes\r
\r
\r
kiwi.view.ServerSelect = Backbone.View.extend({\r
- that: null,\r
-\r
events: {\r
'submit form': 'submitLogin',\r
'click .show_more': 'showMore'\r
},\r
\r
initialize: function () {\r
- that = this;\r
-\r
this.$el = $($('#tmpl_server_select').html());\r
\r
- kiwi.gateway.on('onconnect', this.networkConnected);\r
- kiwi.gateway.on('connecting', this.networkConnecting);\r
+ kiwi.gateway.bind('onconnect', this.networkConnected, this);\r
+ kiwi.gateway.bind('connecting', this.networkConnecting, this);\r
},\r
\r
submitLogin: function (event) {\r
channel: $('.channel', this.$el).val()\r
};\r
\r
- that.trigger('server_connect', values);\r
+ this.trigger('server_connect', values);\r
return false;\r
},\r
\r
\r
show: function () {\r
this.$el.show();\r
- $('.nick', that.$el).focus();\r
+ $('.nick', this.$el).focus();\r
},\r
\r
setStatus: function (text, class_name) {\r
},\r
\r
networkConnected: function (event) {\r
- that.setStatus('Connected :)', 'ok');\r
+ this.setStatus('Connected :)', 'ok');\r
$('form', this.$el).hide();\r
},\r
\r
networkConnecting: function (event) {\r
- that.setStatus('Connecting..', 'ok');\r
+ this.setStatus('Connecting..', 'ok');\r
}\r
});\r
\r
this.$container.parent().css('right', '0');\r
}\r
\r
- kiwi.app.topicbar.setCurrentTopic(this.model.get("topic") || "");\r
-\r
this.scrollToBottom();\r
\r
this.trigger('active', this.model);\r
},\r
\r
initialize: function () {\r
+ kiwi.app.panels.bind('active', function (active_panel) {\r
+ this.setCurrentTopic(active_panel.get('topic'));\r
+ }, this);\r
},\r
\r
process: function (ev) {\r