1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 15:19:42 +02:00

upgraded Ember and integrated Bootstrap 4

Upgraded to Ember JS 2.16.x release. This upgrade uses the new JavaScript modules API syntax.

Integrated Bootstrap 4 Beta 2 via package.json and associated popper.js library. Overridden Bootstrap styles using bootstrap.scss -- this file selectively imports the modules we need.
This commit is contained in:
Harvey Kandola 2017-11-16 13:28:05 +00:00
parent 0f04be4ea1
commit b31ab712c1
229 changed files with 1610 additions and 3181 deletions

View file

@ -9,21 +9,18 @@
//
// https://documize.com
import Ember from 'ember';
import { empty } from '@ember/object/computed';
import Component from '@ember/component';
import { computed, set } from '@ember/object';
import { isPresent, isEqual, isEmpty } from '@ember/utils';
import AuthProvider from '../mixins/auth';
const {
computed,
isEmpty,
isEqual,
isPresent
} = Ember;
export default Ember.Component.extend(AuthProvider, {
export default Component.extend(AuthProvider, {
password: { password: "", confirmation: "" },
hasFirstnameError: computed.empty('model.firstname'),
hasLastnameError: computed.empty('model.lastname'),
hasEmailError: computed.empty('model.email'),
hasFirstnameError: empty('model.firstname'),
hasLastnameError: empty('model.lastname'),
hasEmailError: empty('model.email'),
hasPasswordError: computed('passwordError', 'password.password', {
get() {
if (isPresent(this.get('passwordError'))) {
@ -61,23 +58,23 @@ export default Ember.Component.extend(AuthProvider, {
}
if (isPresent(password) && isEmpty(confirmation)) {
Ember.set(this, 'confirmPasswordError', 'error');
set(this, 'confirmPasswordError', 'error');
return $("#confirmPassword").focus();
}
if (isEmpty(password) && isPresent(confirmation)) {
Ember.set(this, 'passwordError', 'error');
set(this, 'passwordError', 'error');
return $("#password").focus();
}
if (!isEqual(password, confirmation)) {
Ember.set(this, 'passwordError', 'error');
set(this, 'passwordError', 'error');
return $("#password").focus();
}
let passwords = this.get('password');
this.get('save')(passwords).finally(() => {
Ember.set(this, 'password.password', '');
Ember.set(this, 'password.confirmation', '');
set(this, 'password.password', '');
set(this, 'password.confirmation', '');
});
}
}