UNPKG

wejsv2old-plugin-cdp-profile

Version:
31 lines (28 loc) 1.05 kB
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') });