js_upload: use empty string if no newalbum or album input element is found (#712)

This commit is contained in:
rabuzarus 2018-08-20 06:25:35 +02:00 committed by Hypolite Petovan
parent 77b7b73288
commit 6e4abdb875

View File

@ -96,10 +96,16 @@ function createUploader() {
debug: true,
sizeLimit: $maximagesize,
onSubmit: function(id,filename) {
if (typeof acl!="undefined"){
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"){
uploader.setParams( {
newalbum : document.getElementById('photos-upload-newalbum').value,
album : document.getElementById('photos-upload-album-select').value,
newalbum : newalbum,
album : album,
not_visible : document.getElementById('photos-upload-noshare').checked,
group_allow : acl.allow_gid.join(','),
contact_allow : acl.allow_cid.join(','),
@ -108,8 +114,8 @@ function createUploader() {
});
} else {
uploader.setParams( {
newalbum : document.getElementById('photos-upload-newalbum').value,
album : document.getElementById('photos-upload-album-select').value,
newalbum : newalbum,
album : album,
not_visible : document.getElementById('photos-upload-noshare').checked,
group_allow : getSelected(document.getElementById('group_allow')).join(','),
contact_allow : getSelected(document.getElementById('contact_allow')).join(','),