1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

Rebind dropzone elements for section attachments

This commit is contained in:
sauls8t 2019-04-29 13:34:38 +01:00
parent 34d1639899
commit b971c52469
4 changed files with 1145 additions and 1126 deletions

View file

@ -41,8 +41,8 @@ func main() {
rt.Product = domain.Product{}
rt.Product.Major = "2"
rt.Product.Minor = "4"
rt.Product.Patch = "1"
rt.Product.Revision = "190426114302"
rt.Product.Patch = "2"
rt.Product.Revision = "190429132654"
rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
rt.Product.Edition = domain.CommunityEdition
rt.Product.Title = fmt.Sprintf("%s Edition", rt.Product.Edition)

File diff suppressed because one or more lines are too long

View file

@ -25,7 +25,6 @@ export default Component.extend(Modals, Notifier, {
return `page-uploader-${page.id}`;
}),
uploadLabel: 'Upload Attachments',
uploaderReady: false,
didReceiveAttrs() {
this._super(...arguments);
@ -42,12 +41,31 @@ export default Component.extend(Modals, Notifier, {
didRender() {
this._super(...arguments);
// For authenticated users we send server auth token.
let qry = '';
if (this.get('session.hasSecureToken')) {
qry = '?secure=' + this.get('session.secureToken');
} else if (this.get('session.authenticated')) {
qry = '?token=' + this.get('session.authToken');
}
this.set('downloadQuery', qry);
// We don't setup uploader if not edit mode.
if (!this.get('editMode') || this.get('uploaderReady')) {
if (!this.get('editMode')) {
return;
}
// Remove any previous Dropzone init.
for (var j=0; j < 2; j++) {
let dz = this.get('dzone' + j);
if (!_.isNull(dz) && !_.isUndefined(dz)) {
dz.destroy();
this.set('dzone' + j, null);
}
}
let self = this;
let documentId = this.get('document.id');
let pageId = this.get('page.id');
@ -94,9 +112,10 @@ export default Component.extend(Modals, Notifier, {
dzone.on("complete", function (file) {
dzone.removeFile(file);
});
}
this.set('uploaderReady', true);
this.set('dzone' + i, dzone);
}
},
actions: {

View file

@ -1,6 +1,6 @@
{
"name": "documize",
"version": "2.4.0",
"version": "2.4.2",
"description": "The Document IDE",
"repository": "",
"license": "AGPL",