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,
|
2016-06-11 19:52:36 +03:00
|
|
|
isBlank,
|
|
|
|
Object: EmberObject
|
2016-04-26 12:45:59 +03:00
|
|
|
} = Ember;
|
|
|
|
|
2016-06-11 19:52:36 +03:00
|
|
|
export default EmberObject.extend(ValidationEngine, {
|
2016-04-26 12:45:59 +03:00
|
|
|
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);
|
|
|
|
})
|
|
|
|
});
|