2016-04-26 12:45:59 +03:00
|
|
|
import Ember from 'ember';
|
2016-05-24 15:06:59 +03:00
|
|
|
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
2016-04-26 12:45:59 +03:00
|
|
|
|
|
|
|
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);
|
|
|
|
})
|
|
|
|
});
|