[IMP] nivification of Loading widget

bzr revid: chs@openerp.com-20111115165530-mvunu1bsuiq1k4du
This commit is contained in:
Christophe Simonis 2011-11-15 17:55:30 +01:00
parent 7d4de5867c
commit 4d7a24e814
2 changed files with 11 additions and 6 deletions

View File

@ -184,7 +184,8 @@ openerp.web.CrashManager = openerp.web.CallbackEnabled.extend({
}
});
openerp.web.Loading = openerp.web.Widget.extend(/** @lends openerp.web.Loading# */{
openerp.web.Loading = openerp.web.Widget.extend(/** @lends openerp.web.Loading# */{
template: 'Loading',
/**
* @constructs openerp.web.Loading
* @extends openerp.web.Widget
@ -192,8 +193,8 @@ openerp.web.Loading = openerp.web.Widget.extend(/** @lends openerp.web.Loading#
* @param parent
* @param element_id
*/
init: function(parent, element_id) {
this._super(parent, element_id);
init: function(parent) {
this._super(parent);
this.count = 0;
this.blocked_ui = false;
this.session.on_rpc_request.add_first(this.on_rpc_event, 1);
@ -210,12 +211,13 @@ openerp.web.Loading = openerp.web.Widget.extend(/** @lends openerp.web.Loading#
}
this.count += increment;
if (this.count) {
if (this.count > 0) {
//this.$element.html(QWeb.render("Loading", {}));
this.$element.html("Loading ("+this.count+")");
this.$element.show();
this.widget_parent.$element.addClass('loading');
} else {
this.count = 0;
clearTimeout(this.long_running_timer);
// Don't unblock if blocked by somebody else
if (self.blocked_ui) {
@ -982,7 +984,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
this.$element.html(QWeb.render("Interface", params));
this.notification = new openerp.web.Notification(this);
this.loading = new openerp.web.Loading(this,"oe_loading");
this.loading = new openerp.web.Loading(this);
this.crashmanager = new openerp.web.CrashManager();
this.header = new openerp.web.Header(this);
@ -1006,6 +1008,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
start: function() {
this._super.apply(this, arguments);
this.notification.prependTo(this.$element);
this.loading.appendTo($('#oe_loading'));
this.header.appendTo($("#oe_header"));
this.session.start();
this.login.appendTo($('#oe_login'));

View File

@ -18,7 +18,7 @@
</div>
</t>
<t t-name="Interface">
<div id="oe_loading" class="loading"></div>
<div id="oe_loading"></div>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" class="main_table">
<tr>
<td colspan="2" valign="top">
@ -63,7 +63,9 @@
</table>
</t>
<t t-name="Loading">
<div class="loading">
Loading...
</div>
</t>
<t t-name="Database">
<ul class="db_options" style="padding: 0px; display: inline;">