mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 22:02:11 +03:00
26 lines
671 B
JavaScript
26 lines
671 B
JavaScript
import computed from 'ember-computed';
|
|
import {isBlank} from 'ember-utils';
|
|
import EmberObject from 'ember-object';
|
|
|
|
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
|
|
|
export default EmberObject.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);
|
|
})
|
|
});
|