Commit afc0315e authored by Ruslan Kabalin's avatar Ruslan Kabalin
Browse files

filebrowser: upload_feedback refactoring and renaming


Signed-off-by: default avatarRuslan Kabalin <ruslan.kabalin@luns.net.uk>
parent a8f23f5f
...@@ -192,21 +192,23 @@ function FileBrowser(idprefix, folderid, config, globalconfig) { ...@@ -192,21 +192,23 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
} }
} }
this.upload_feedback = function (data) { this.callback_feedback = function (data) {
if (data.problem) { if (data.problem) {
var image = 'images/icon_problem.gif'; var image = 'images/icon_problem.gif';
} }
else if (!data.error) { else if (data.error) {
var image = 'images/success.gif'; var image = 'images/failure.gif';
} }
else { else {
var image = 'images/failure.gif'; var image = 'images/success.gif';
} }
quotaUpdate(data.quotaused, data.quota); quotaUpdate(data.quotaused, data.quota);
var newmessage = makeMessage(DIV(null,IMG({'src':get_themeurl(image)}), ' ', data.message), 'info'); var newmessage = makeMessage(DIV(null,IMG({'src':get_themeurl(image)}), ' ', data.message), 'info');
setNodeAttribute(newmessage, 'id', 'uploadstatusline' + data.uploadnumber); setNodeAttribute(newmessage, 'id', 'uploadstatusline' + data.uploadnumber);
removeElement($('uploadstatusline'+data.uploadnumber)); if (data.uploadnumber) {
removeElement($('uploadstatusline'+data.uploadnumber));
}
appendChildNodes(self.id + '_upload_messages', newmessage); appendChildNodes(self.id + '_upload_messages', newmessage);
} }
...@@ -564,7 +566,7 @@ function FileBrowser(idprefix, folderid, config, globalconfig) { ...@@ -564,7 +566,7 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
this.callback = function (form, data) { this.callback = function (form, data) {
self.form = form; // ???? self.form = form; // ????
if (data.uploaded || data.error) { if (data.uploaded || data.error) {
self.upload_feedback(data); // Remove uploading message self.callback_feedback(data); // add/update message
} }
// Only update the file listing if the user hasn't changed folders yet // Only update the file listing if the user hasn't changed folders yet
if (data.newlist && (data.folder == self.folderid || data.changedfolder)) { if (data.newlist && (data.folder == self.folderid || data.changedfolder)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment