28 lines
622 B
JavaScript
28 lines
622 B
JavaScript
|
import Ember from 'ember';
|
||
|
import ValidationEngine from 'ghost/mixins/validation-engine';
|
||
|
|
||
|
const {
|
||
|
computed,
|
||
|
isBlank
|
||
|
} = Ember;
|
||
|
|
||
|
export default Ember.Object.extend(ValidationEngine, {
|
||
|
label: '',
|
||
|
url: '',
|
||
|
isNew: false,
|
||
|
|
||
|
validationType: 'navItem',
|
||
|
|
||
|
isComplete: computed('label', 'url', function () {
|
||
|
let {label, url} = this.getProperties('label', 'url');
|
||
|
|
||
|
return !isBlank(label) && !isBlank(url);
|
||
|
}),
|
||
|
|
||
|
isBlank: computed('label', 'url', function () {
|
||
|
let {label, url} = this.getProperties('label', 'url');
|
||
|
|
||
|
return isBlank(label) && isBlank(url);
|
||
|
})
|
||
|
});
|