Added callback to upload.show function

This commit is contained in:
Tobias Reich 2014-07-23 21:23:10 +02:00
parent 6c983eb04d
commit b905d3c51f

View File

@ -7,11 +7,13 @@
upload = { upload = {
show: function(title, files) { show: function(title, files, callback) {
upload.close(true); upload.close(true);
$("body").append(build.uploadModal(title, files)); $("body").append(build.uploadModal(title, files));
if (callback!=null&&callback!=undefined) callback();
}, },
setIcon: function(icon) { setIcon: function(icon) {
@ -195,9 +197,9 @@ upload = {
supported: true supported: true
} }
upload.show("Importing URL", files); upload.show("Importing URL", files, function() {
$(".upload_message .rows .row:nth-child(1) .status").html("Importing");
//$(".upload_message .rows .row:nth-child(1) .status").html("Importing"); });
params = "importUrl&url=" + escape(encodeURI(link)) + "&albumID=" + albumID; params = "importUrl&url=" + escape(encodeURI(link)) + "&albumID=" + albumID;
lychee.api(params, function(data) { lychee.api(params, function(data) {
@ -296,7 +298,9 @@ upload = {
// Remove last comma // Remove last comma
links = links.substr(0, links.length-1); links = links.substr(0, links.length-1);
upload.show("Importing from Dropbox", files); upload.show("Importing from Dropbox", files, function() {
$(".upload_message .rows .row .status").html("Importing");
});
params = "importUrl&url=" + escape(links) + "&albumID=" + albumID; params = "importUrl&url=" + escape(links) + "&albumID=" + albumID;
lychee.api(params, function(data) { lychee.api(params, function(data) {