mirror of
https://github.com/documize/community.git
synced 2025-07-28 09:39:42 +02:00
fixed doc import and add space bugs
This commit is contained in:
parent
cbcb7a380f
commit
34199ae8e6
1 changed files with 45 additions and 39 deletions
|
@ -29,6 +29,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
importedDocuments: [],
|
importedDocuments: [],
|
||||||
isFolderOwner: computed.equal('folder.userId', 'session.user.id'),
|
isFolderOwner: computed.equal('folder.userId', 'session.user.id'),
|
||||||
moveFolderId: "",
|
moveFolderId: "",
|
||||||
|
drop: null,
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this.set('isFolderOwner', this.get('folder.userId') === this.get("session.user.id"));
|
this.set('isFolderOwner', this.get('folder.userId') === this.get("session.user.id"));
|
||||||
|
@ -56,16 +57,13 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
this.addTooltip(document.getElementById("import-document-button"));
|
this.addTooltip(document.getElementById("import-document-button"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
didInsertElement() {
|
if (this.get('folderService').get('canEditCurrentFolder')) {
|
||||||
let self = this;
|
let self = this;
|
||||||
let folderId = this.get('folder.id');
|
let folderId = this.get('folder.id');
|
||||||
let url = this.get('appMeta.endpoint');
|
let url = this.get('appMeta.endpoint');
|
||||||
let importUrl = `${url}/import/folder/${folderId}`;
|
let importUrl = `${url}/import/folder/${folderId}`;
|
||||||
|
|
||||||
Dropzone.options.uploadDocuments = false;
|
|
||||||
|
|
||||||
let dzone = new Dropzone("#import-document-button > i", {
|
let dzone = new Dropzone("#import-document-button > i", {
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer ' + self.get('session.session.content.authenticated.token')
|
'Authorization': 'Bearer ' + self.get('session.session.content.authenticated.token')
|
||||||
|
@ -102,9 +100,17 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
dzone.on("complete", function (file) {
|
dzone.on("complete", function (file) {
|
||||||
dzone.removeFile(file);
|
dzone.removeFile(file);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.set('drop', dzone);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
|
if (is.not.null(this.get('drop'))) {
|
||||||
|
this.get('drop').destroy();
|
||||||
|
this.set('drop', null);
|
||||||
|
}
|
||||||
|
|
||||||
this.destroyTooltips();
|
this.destroyTooltips();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue