|
@@ -21,6 +21,8 @@ var App = require('app');
|
|
|
App.MainAdminUserCreateView = Em.View.extend({
|
|
|
templateName: require('templates/main/admin/user/create'),
|
|
|
userId: false,
|
|
|
+ isPasswordDirty: false,
|
|
|
+
|
|
|
create: function(event){
|
|
|
var parent_controller=this.get("controller").controllers.mainAdminUserController;
|
|
|
var form = this.get("userForm");
|
|
@@ -76,6 +78,16 @@ App.MainAdminUserCreateView = Em.View.extend({
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ passwordValidation: function() {
|
|
|
+ var passwordValue = this.get('userForm').getField('password').get('value');
|
|
|
+ if (passwordValue && !this.get('isPasswordDirty')) {
|
|
|
+ this.set('isPasswordDirty', true);
|
|
|
+ }
|
|
|
+ if (this.get('isPasswordDirty')) {
|
|
|
+ this.get('userForm').isValid();
|
|
|
+ }
|
|
|
+ }.observes('userForm.fields.@each.value'),
|
|
|
+
|
|
|
didInsertElement: function(){
|
|
|
this.get('userForm').propertyDidChange('object');
|
|
|
}
|