},\r
\r
submitForm: function (event) {\r
+ event.preventDefault();\r
+\r
+ // Make sure a nick is chosen\r
+ if (!$('input.nick', this.$el).val().trim()) {\r
+ this.setStatus('Select a nickname first!');\r
+ $('input.nick', this.$el).select();\r
+ return;\r
+ }\r
+\r
if (state === 'nick_change') {\r
this.submitNickChange(event);\r
} else {\r
}\r
\r
$('button', this.$el).attr('disabled', 1);\r
- return false;\r
+ return;\r
},\r
\r
submitLogin: function (event) {\r
$('.status', this.$el)\r
.text(text)\r
.attr('class', 'status')\r
- .addClass(class_name)\r
+ .addClass(class_name||'')\r
.show();\r
},\r
clearStatus: function () {\r