mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-22 14:23:47 +00:00
js_upload: use empty string if no newalbum or album input element is found (#712)
This commit is contained in:
parent
77b7b73288
commit
6e4abdb875
1 changed files with 21 additions and 15 deletions
|
@ -96,10 +96,16 @@ function createUploader() {
|
||||||
debug: true,
|
debug: true,
|
||||||
sizeLimit: $maximagesize,
|
sizeLimit: $maximagesize,
|
||||||
onSubmit: function(id,filename) {
|
onSubmit: function(id,filename) {
|
||||||
|
var newalbumElm = document.getElementById('photos-upload-newalbum');
|
||||||
|
var albumElm = document.getElementById('photos-upload-album-select');
|
||||||
|
|
||||||
|
var newalbum = newalbumElm ? newalbumElm.value : "";
|
||||||
|
var album = albumElm ? albumElm.value : "";
|
||||||
|
|
||||||
if (typeof acl != "undefined"){
|
if (typeof acl != "undefined"){
|
||||||
uploader.setParams( {
|
uploader.setParams( {
|
||||||
newalbum : document.getElementById('photos-upload-newalbum').value,
|
newalbum : newalbum,
|
||||||
album : document.getElementById('photos-upload-album-select').value,
|
album : album,
|
||||||
not_visible : document.getElementById('photos-upload-noshare').checked,
|
not_visible : document.getElementById('photos-upload-noshare').checked,
|
||||||
group_allow : acl.allow_gid.join(','),
|
group_allow : acl.allow_gid.join(','),
|
||||||
contact_allow : acl.allow_cid.join(','),
|
contact_allow : acl.allow_cid.join(','),
|
||||||
|
@ -108,8 +114,8 @@ function createUploader() {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uploader.setParams( {
|
uploader.setParams( {
|
||||||
newalbum : document.getElementById('photos-upload-newalbum').value,
|
newalbum : newalbum,
|
||||||
album : document.getElementById('photos-upload-album-select').value,
|
album : album,
|
||||||
not_visible : document.getElementById('photos-upload-noshare').checked,
|
not_visible : document.getElementById('photos-upload-noshare').checked,
|
||||||
group_allow : getSelected(document.getElementById('group_allow')).join(','),
|
group_allow : getSelected(document.getElementById('group_allow')).join(','),
|
||||||
contact_allow : getSelected(document.getElementById('contact_allow')).join(','),
|
contact_allow : getSelected(document.getElementById('contact_allow')).join(','),
|
||||||
|
|
Loading…
Reference in a new issue