mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Username change: check length in js, we don't need the server to do it
This commit is contained in:
@@ -26,6 +26,9 @@ Discourse.PreferencesUsernameController = Discourse.ObjectController.extend({
|
||||
}).property('newUsername', 'content.username'),
|
||||
|
||||
checkTaken: (function() {
|
||||
if( this.get('newUsername') && this.get('newUsername').length < 3 ) {
|
||||
this.set('errorMessage', Em.String.i18n('user.name.too_short'));
|
||||
} else {
|
||||
var _this = this;
|
||||
this.set('taken', false);
|
||||
this.set('errorMessage', null);
|
||||
@@ -38,6 +41,7 @@ Discourse.PreferencesUsernameController = Discourse.ObjectController.extend({
|
||||
return _this.set('taken', true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).observes('newUsername'),
|
||||
|
||||
saveButtonText: (function() {
|
||||
|
||||
Reference in New Issue
Block a user