2017-08-22 10:53:26 +03:00
|
|
|
import EmberObject from '@ember/object';
|
2016-06-30 13:21:47 +03:00
|
|
|
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
2017-08-22 10:53:26 +03:00
|
|
|
import {computed} from '@ember/object';
|
|
|
|
import {isBlank} from '@ember/utils';
|
2016-04-26 12:45:59 +03:00
|
|
|
|
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);
|
|
|
|
})
|
|
|
|
});
|