mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +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);
|
|
})
|
|
});
|