wejsv2old-plugin-cdp-profile
Version:
We.js plugin wejsv2old-plugin-cdp-profile
31 lines (28 loc) • 1.05 kB
JavaScript
App.PasswordInvalidMixin = Ember.Mixin.create({
checkNewPassword: function (){
if (this.get('newPassword') != this.get('rNewPassword')) {
return this.setProperties({
newPasswordErr: true,
newPasswordErrMessage: 'As senhas tem que ser iguais'
})
} else {
return this.set('newPasswordErr', false);
}
}.observes('newPassword', 'rNewPassword'),
checkNewRPassword: function (){
if (this.get('newPassword') != this.get('rNewPassword')) {
return this.setProperties({
rNewPasswordErr: true,
rNewPasswordErrMessage: 'As senhas tem que ser iguais'
})
} else {
return this.set('rNewPasswordErr', false);
}
}.observes('rNewPassword'),
newPasswordInvalid: function (){
var bool = Boolean( Ember.isEmpty(this.get('currPassword')) ||
this.get('newPasswordErr') || Ember.isEmpty(this.get('newPassword')) ||
this.get('rNewPasswordErr') || Ember.isEmpty(this.get('rNewPassword')) )
return bool;
}.property('currPassword','newPasswordErr','rNewPasswordErr')
});