Ghost/ghost/admin/app/models/navigation-item.js

28 lines
622 B
JavaScript
Raw Normal View History

import Ember from 'ember';
import ValidationEngine from 'ghost/mixins/validation-engine';
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);
})
});