mirror of
https://github.com/documize/community.git
synced 2025-07-20 21:59:42 +02:00
Rebind dropzone elements for section attachments
This commit is contained in:
parent
34d1639899
commit
b971c52469
4 changed files with 1145 additions and 1126 deletions
|
@ -41,8 +41,8 @@ func main() {
|
||||||
rt.Product = domain.Product{}
|
rt.Product = domain.Product{}
|
||||||
rt.Product.Major = "2"
|
rt.Product.Major = "2"
|
||||||
rt.Product.Minor = "4"
|
rt.Product.Minor = "4"
|
||||||
rt.Product.Patch = "1"
|
rt.Product.Patch = "2"
|
||||||
rt.Product.Revision = "190426114302"
|
rt.Product.Revision = "190429132654"
|
||||||
rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
|
rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
|
||||||
rt.Product.Edition = domain.CommunityEdition
|
rt.Product.Edition = domain.CommunityEdition
|
||||||
rt.Product.Title = fmt.Sprintf("%s Edition", rt.Product.Edition)
|
rt.Product.Title = fmt.Sprintf("%s Edition", rt.Product.Edition)
|
||||||
|
|
2238
embed/bindata.go
2238
embed/bindata.go
File diff suppressed because one or more lines are too long
|
@ -25,7 +25,6 @@ export default Component.extend(Modals, Notifier, {
|
||||||
return `page-uploader-${page.id}`;
|
return `page-uploader-${page.id}`;
|
||||||
}),
|
}),
|
||||||
uploadLabel: 'Upload Attachments',
|
uploadLabel: 'Upload Attachments',
|
||||||
uploaderReady: false,
|
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
@ -43,11 +42,30 @@ export default Component.extend(Modals, Notifier, {
|
||||||
didRender() {
|
didRender() {
|
||||||
this._super(...arguments);
|
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.
|
// We don't setup uploader if not edit mode.
|
||||||
if (!this.get('editMode') || this.get('uploaderReady')) {
|
if (!this.get('editMode')) {
|
||||||
return;
|
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 self = this;
|
||||||
let documentId = this.get('document.id');
|
let documentId = this.get('document.id');
|
||||||
let pageId = this.get('page.id');
|
let pageId = this.get('page.id');
|
||||||
|
@ -94,9 +112,10 @@ export default Component.extend(Modals, Notifier, {
|
||||||
dzone.on("complete", function (file) {
|
dzone.on("complete", function (file) {
|
||||||
dzone.removeFile(file);
|
dzone.removeFile(file);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
this.set('uploaderReady', true);
|
|
||||||
|
this.set('dzone' + i, dzone);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "documize",
|
"name": "documize",
|
||||||
"version": "2.4.0",
|
"version": "2.4.2",
|
||||||
"description": "The Document IDE",
|
"description": "The Document IDE",
|
||||||
"repository": "",
|
"repository": "",
|
||||||
"license": "AGPL",
|
"license": "AGPL",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue