1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 23:59:47 +02:00

document tag editor re-vamped

This commit is contained in:
Harvey Kandola 2017-09-25 11:52:26 +01:00
parent d6e18b4289
commit 9ccd0fd19c
9 changed files with 54 additions and 48 deletions

View file

@ -21,8 +21,11 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
hasCategories: Ember.computed('categories', function() {
return this.get('categories').length > 0;
}),
canAdd: Ember.computed('categories', function() {
return this.get('categories').length > 0 && this.get('permissions.documentEdit');
canSelectCategory: Ember.computed('categories', function() {
return (this.get('categories').length > 0 && this.get('permissions.documentEdit'));
}),
canAddCategory: Ember.computed('categories', function() {
return this.get('permissions.spaceOwner') || this.get('permissions.spaceManage');
}),
init() {

View file

@ -16,7 +16,10 @@ export default Ember.Component.extend({
tagz: [],
newTag: "",
maxTags: 3,
canAdd: false,
canAdd: false,
emptyState: Ember.computed('tagz', function() {
return (this.get('tagz').length === 0 && !this.get('permissions.documentEdit'));
}),
init() {
this._super(...arguments);
@ -36,15 +39,14 @@ export default Ember.Component.extend({
},
didUpdateAttrs() {
this._super(...arguments);
this.set('canAdd', this.get('permissions.documentEdit') && this.get('tagz').get('length') < 3);
},
didInsertElement() {
},
willDestroyElement() {
$("#add-tag-field").off("keydown");
this._super(...arguments);
$("#add-tag-field").off("keydown");
},
actions: {