mirror of
https://github.com/documize/community.git
synced 2025-07-22 22:59:43 +02:00
Better UX for custom logo upload
Resolves issue with phantom click.
This commit is contained in:
parent
7f2d2c01a6
commit
d8cb69b6c0
1 changed files with 33 additions and 31 deletions
|
@ -40,41 +40,43 @@ export default Component.extend(Notifier, {
|
||||||
let orgId = this.get('appMeta.orgId');
|
let orgId = this.get('appMeta.orgId');
|
||||||
let uploadUrl = `${url}/organization/${orgId}/logo`;
|
let uploadUrl = `${url}/organization/${orgId}/logo`;
|
||||||
|
|
||||||
let dzone = new Dropzone("#upload-logo > div", {
|
// Handle upload clicks on button and anything inside that button.
|
||||||
headers: {
|
let sel = ['#upload-logo', '#upload-logo > div'];
|
||||||
'Authorization': 'Bearer ' + self.get('session.authToken')
|
for (var i=0; i < 2; i++) {
|
||||||
},
|
let dzone = new Dropzone(sel[i], {
|
||||||
url: uploadUrl,
|
headers: {
|
||||||
method: "post",
|
'Authorization': 'Bearer ' + self.get('session.authToken')
|
||||||
paramName: 'attachment',
|
},
|
||||||
clickable: true,
|
url: uploadUrl,
|
||||||
maxFilesize: 50,
|
method: "post",
|
||||||
parallelUploads: 1,
|
paramName: 'attachment',
|
||||||
uploadMultiple: false,
|
clickable: true,
|
||||||
addRemoveLinks: false,
|
maxFilesize: 50,
|
||||||
autoProcessQueue: true,
|
parallelUploads: 1,
|
||||||
createImageThumbnails: false,
|
uploadMultiple: false,
|
||||||
|
addRemoveLinks: false,
|
||||||
|
autoProcessQueue: true,
|
||||||
|
createImageThumbnails: false,
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
this.on("success", function (/*file, response*/ ) {
|
this.on("success", function (/*file, response*/ ) {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on("queuecomplete", function () {
|
this.on("queuecomplete", function () {
|
||||||
self.notifySuccess('Logo uploaded');
|
self.notifySuccess('Logo uploaded');
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on("error", function (error, msg) {
|
this.on("error", function (error, msg) {
|
||||||
self.notifyError(msg);
|
self.notifyError(msg);
|
||||||
self.notifyError(error);
|
self.notifyError(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
dzone.on("complete", function (file) {
|
dzone.on("complete", function (file) {
|
||||||
dzone.removeFile(file);
|
dzone.removeFile(file);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
this.set('drop', dzone);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue