mirror of
https://github.com/documize/community.git
synced 2025-07-21 14:19:43 +02:00
[WIP] moved start-document functionality, reworked folder view
WIP -- import files still BROKEN
This commit is contained in:
parent
8f80673cde
commit
a0a1dd396a
20 changed files with 2820 additions and 2039 deletions
|
@ -14,43 +14,13 @@ import Ember from 'ember';
|
|||
export default Ember.Component.extend({
|
||||
folderService: Ember.inject.service('folder'),
|
||||
moveTarget: null,
|
||||
emptyState: Ember.computed('documents', function() {
|
||||
return this.get('documents.length') === 0;
|
||||
}),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.set('canCreate', this.get('permissions.documentAdd'));
|
||||
this.set('deleteTargets', this.get('folders').rejectBy('id', this.get('folder.id')));
|
||||
},
|
||||
|
||||
didUpdateAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.setupAddWizard();
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.setupAddWizard();
|
||||
},
|
||||
|
||||
setupAddWizard() {
|
||||
Ember.run.schedule('afterRender', () => {
|
||||
$('.start-document:not(.start-document-empty-state)').off('.hoverIntent');
|
||||
|
||||
$('.start-document:not(.start-document-empty-state)').hoverIntent({interval: 100, over: function() {
|
||||
// in
|
||||
$(this).find('.start-button').velocity("transition.slideDownIn", {duration: 300});
|
||||
}, out: function() {
|
||||
// out
|
||||
$(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
|
||||
} });
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
selectDocument(documentId) {
|
||||
let doc = this.get('documents').findBy('id', documentId);
|
||||
|
@ -65,39 +35,6 @@ export default Ember.Component.extend({
|
|||
}
|
||||
|
||||
this.set('selectedDocuments', list);
|
||||
},
|
||||
|
||||
onDelete() {
|
||||
this.get("onDeleteSpace")();
|
||||
},
|
||||
|
||||
onImport() {
|
||||
this.get('onImport')();
|
||||
},
|
||||
|
||||
onShowDocumentWizard(docId) {
|
||||
if ($("#new-document-wizard").is(':visible') && this.get('docId') === docId) {
|
||||
this.send('onHideDocumentWizard');
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('docId', docId);
|
||||
|
||||
if (docId === '') {
|
||||
$("#new-document-wizard").insertAfter('#wizard-placeholder');
|
||||
} else {
|
||||
$("#new-document-wizard").insertAfter(`#document-${docId}`);
|
||||
}
|
||||
|
||||
$("#new-document-wizard").velocity("transition.slideDownIn", { duration: 300, complete:
|
||||
function() {
|
||||
$("#new-document-name").focus();
|
||||
}});
|
||||
},
|
||||
|
||||
onHideDocumentWizard() {
|
||||
$("#new-document-wizard").insertAfter('#wizard-placeholder');
|
||||
$("#new-document-wizard").velocity("transition.slideUpOut", { duration: 300 });
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue