MDL-16597, added loadding indicator

This commit is contained in:
Dongsheng Cai 2010-05-19 03:44:57 +00:00
parent 4676eaf79b
commit 403eabd4e5

View File

@ -80,7 +80,27 @@ M.form_filemanager.init = function(Y, options) {
this.render();
},
request: function(args) {
wait: function(client_id) {
var panel = Y.one('#draftfiles-'+client_id);
if (!panel) {
var container = Y.one('#filemanager-'+client_id);
var html = Y.Node.create('<ul id="draftfiles-'+client_id+'"></ul>');
container.appendChild(html);
panel = Y.one('#draftfiles-'+client_id);
} else {
panel.set('innerHTML', '');
}
var name = '';
var str = '<div style="text-align:center">';
str += '<img src="'+M.util.image_url('i/progressbar')+'" />';
str += '</div>';
try {
panel.set('innerHTML', str);
} catch(e) {
alert(e.toString());
}
},
request: function(args, redraw) {
var api = this.api + '?action='+args.action;
var params = {};
var scope = this;
@ -122,6 +142,9 @@ M.form_filemanager.init = function(Y, options) {
cfg.form = args.form;
}
Y.io(api, cfg);
if (redraw) {
this.wait(this.client_id);
}
},
filepicker_callback: function(obj) {
var button_addfile = Y.one("#btnadd-"+this.client_id);
@ -150,7 +173,7 @@ M.form_filemanager.init = function(Y, options) {
scope.options = obj;
scope.render(obj);
}
});
}, true);
},
setup_buttons: function() {
var button_download = Y.one("#btndwn-"+this.client_id);
@ -281,7 +304,7 @@ M.form_filemanager.init = function(Y, options) {
scope.options = obj;
scope.render(obj);
}
});
}, true);
}, this, args);
}
}