1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-20 21:59:42 +02:00

delete docs moved to new UX

This commit is contained in:
Harvey Kandola 2017-11-22 13:39:46 +00:00
parent 9cbee80f51
commit bae1245d47
13 changed files with 199 additions and 89 deletions

View file

@ -10,18 +10,43 @@
// https://documize.com
import { computed } from '@ember/object';
import Component from '@ember/component';
export default Component.extend({
showDeleteDialog: false,
selectedDocuments: [],
showAdd: computed('permissions', 'documents', function() {
return this.get('documents.length') === 0 && this.get('permissions.documentAdd');
}),
showLockout: computed('permissions', 'documents', function() {
return this.get('documents.length') === 0 && !this.get('permissions.documentAdd');
}),
hasDocumentActions: computed('permissions', function() {
return this.get('permissions.documentDelete') || this.get('permissions.documentMove');
}),
actions: {
onConfirmDeleteDocuments() {
this.set('showDeleteDialog', true);
},
onDeleteDocuments() {
this.set('showDeleteDialog', false);
let list = this.get('selectedDocuments');
// list.forEach(d => {
// let doc = this.get('documents').findBy('id', d);
// doc.set('selected', false);
// });
this.attrs.onDeleteDocument(list);
this.set('selectedDocuments', []);
return true;
},
selectDocument(documentId) {
let doc = this.get('documents').findBy('id', documentId);
let list = this.get('selectedDocuments');