[IMP] use blockUI in static home installation, since we got it

bzr revid: xmo@openerp.com-20110804090124-rteblcid3mx59599
This commit is contained in:
Xavier Morel
2011-08-04 11:01:24 +02:00
parent a66bbb20fc
commit e816c34b0a
@@ -77,20 +77,16 @@ openerp.base_default_home = function (openerp) {
[['name', '=', module_name], ['state', '=', 'uninstalled']]),
Upgrade = new openerp.base.DataSet(this, 'base.module.upgrade');
var $overlay = $('<div class="ui-widget-overlay">')
.appendTo(document.body)
.css('z-index', 10001),
$wait = $overlay.add(
$('<img src="/base_default_home/static/src/img/throbber.gif">')
.appendTo(document.body)
.css({position: 'absolute', top: '50%', left: '50%'}));
$.blockUI({
message: '<img src="/base_default_home/static/src/img/throbber.gif">'
});
Modules.read_slice(['id'], null, null, function (records) {
if (!(records.length === 1)) { return; }
Modules.call('state_update',
[_.pluck(records, 'id'), 'to install', ['uninstalled']],
function () {
Upgrade.call('upgrade_module', [[]], function () {
$wait.remove();
$.unblockUI();
// TODO: less brutal reloading
window.location.reload(true);
});