From b905d3c51fc87e55fd4c48069ad2bb11be19d3fe Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Wed, 23 Jul 2014 21:23:10 +0200 Subject: [PATCH] Added callback to upload.show function --- assets/js/upload.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/assets/js/upload.js b/assets/js/upload.js index cf03f6b..e447241 100755 --- a/assets/js/upload.js +++ b/assets/js/upload.js @@ -7,11 +7,13 @@ upload = { - show: function(title, files) { + show: function(title, files, callback) { upload.close(true); $("body").append(build.uploadModal(title, files)); + if (callback!=null&&callback!=undefined) callback(); + }, setIcon: function(icon) { @@ -195,9 +197,9 @@ upload = { supported: true } - upload.show("Importing URL", files); - - //$(".upload_message .rows .row:nth-child(1) .status").html("Importing"); + upload.show("Importing URL", files, function() { + $(".upload_message .rows .row:nth-child(1) .status").html("Importing"); + }); params = "importUrl&url=" + escape(encodeURI(link)) + "&albumID=" + albumID; lychee.api(params, function(data) { @@ -296,7 +298,9 @@ upload = { // Remove last comma 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; lychee.api(params, function(data) {