From: Fabien Meghazi Date: Tue, 18 Oct 2011 14:33:00 +0000 (+0200) Subject: [IMP] change cursor when loading X-Git-Tag: 6.1.0-rc1-addons~1749 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=57a4d1feb90f842b263c40ab0453aafa0817045d;hp=-c;p=odoo%2Fodoo.git [IMP] change cursor when loading bzr revid: fme@openerp.com-20111018143300-jcwmbraqyzi41ho1 --- 57a4d1feb90f842b263c40ab0453aafa0817045d diff --combined addons/web/static/src/css/base.css index f16f016,d08eb40..6872b92 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@@ -40,6 -40,9 +40,9 @@@ body.openerp, .openerp textarea, .opene } /* Loading */ + .loading { + cursor: wait; + } .openerp .loading { display: none; z-index: 100; @@@ -222,7 -225,6 +225,7 @@@ label.error background: #f0eeee; } .openerp .oe-application-container { + width: 100%; height: 100%; } @@@ -1370,20 -1372,19 +1373,20 @@@ } ul.oe-arrow-list { - padding-left: 0.5em; + padding-left: 1.1em; margin: 0; + white-space: nowrap; } ul.oe-arrow-list li { display: inline-block; - margin-left: -0.5em; + margin-left: -1em; } ul.oe-arrow-list li span { vertical-align: top; display: inline-block; border-width:1em; border-style:solid; - border-color: white; + border-color: #DEDEDE; line-height:0em; } ul.oe-arrow-list .oe-arrow-list-before { @@@ -1392,16 -1393,16 +1395,16 @@@ } ul.oe-arrow-list .oe-arrow-list-after { border-color: rgba(0,0,0,0); - border-left-color: white; + border-left-color: #DEDEDE; border-right-width:0; } ul.oe-arrow-list li.oe-arrow-list-selected span { - border-color: #CFCCCC; + border-color: #B5B9FF; } ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-before { border-left-color: rgba(0,0,0,0); } ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after { border-color: rgba(0,0,0,0); - border-left-color: #CFCCCC; + border-left-color: #B5B9FF; } diff --combined addons/web/static/src/js/chrome.js index a74c2cd,7b3dc54..bdb8e23 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@@ -5,16 -5,15 +5,16 @@@ openerp.web.chrome = function(openerp) var QWeb = openerp.web.qweb; openerp.web.Notification = openerp.web.Widget.extend(/** @lends openerp.web.Notification# */{ - /** - * @constructs openerp.web.Notification - * @extends openerp.web.Widget - * - * @param parent - * @param element_id - */ - init: function(parent, element_id) { - this._super(parent, element_id); + template: 'Notification', + identifier_prefix: 'notification-', + + init: function() { + this._super.apply(this, arguments); + openerp.notification = this; + }, + + start: function() { + this._super.apply(this, arguments); this.$element.notify({ speed: 500, expires: 1500 @@@ -29,12 -28,9 +29,12 @@@ warn: function(title, text) { this.$element.notify('create', 'oe_notification_alert', { title: title, - text: text + text: text, + }, { + expires: false, }); - } + }, + }); openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# */{ @@@ -136,11 -132,21 +136,11 @@@ } }); -openerp.web.CrashManager = openerp.web.Dialog.extend(/** @lends openerp.web.CrashManager# */{ - identifier_prefix: 'dialog_crash', - /** - * @constructs opener.web.CrashManager - * @extends openerp.web.Dialog - * - * @param parent - */ +openerp.web.CrashManager = openerp.web.SessionAware.extend({ init: function(parent) { - this._super(parent); + this._super((parent || {}).session); this.session.on_rpc_error.add(this.on_rpc_error); }, - on_button_Ok: function() { - this.close(); - }, on_rpc_error: function(error) { this.error = error; if (error.data.fault_code) { @@@ -151,36 -157,20 +151,36 @@@ } } if (error.code === 200 && error.type) { - this.dialog_title = "OpenERP " + _.capitalize(error.type); - this.template = 'DialogWarning'; - this.open({ - width: 'auto', - height: 'auto' - }); + this.on_managed_error(error); } else { - this.dialog_title = "OpenERP Error"; - this.template = 'DialogTraceback'; - this.open({ - width: 'auto', - height: 'auto' - }); + this.on_traceback(error); } + }, + on_managed_error: function(error) { + $('
' + QWeb.render('DialogWarning', {error: error}) + '
').dialog({ + title: "OpenERP " + _.capitalize(error.type), + buttons: { + Ok: function() { + $(this).dialog("close"); + } + } + }); + }, + on_traceback: function(error) { + var dialog = new openerp.web.Dialog(this, { + title: "OpenERP " + _.capitalize(error.type), + autoOpen: true, + width: '90%', + height: '90%', + min_width: '800px', + min_height: '600px', + buttons: { + Ok: function() { + $(this).dialog("close"); + } + } + }).start(); + dialog.$element.html(QWeb.render('DialogTraceback', {error: error})); } }); @@@ -204,8 -194,10 +204,10 @@@ openerp.web.Loading = openerp.web.Widg //this.$element.html(QWeb.render("Loading", {})); this.$element.html("Loading ("+this.count+")"); this.$element.show(); + this.widget_parent.$element.addClass('loading'); } else { this.$element.fadeOut(); + this.widget_parent.$element.removeClass('loading'); } } }); @@@ -379,7 -371,7 +381,7 @@@ openerp.web.Database = openerp.web.Widg } $db_list.find(':selected').remove(); self.db_list.splice(_.indexOf(self.db_list, db, true), 1); - self.notification.notify("Dropping database", "The database '" + db + "' has been dropped"); + self.do_notify("Dropping database", "The database '" + db + "' has been dropped"); }); } }); @@@ -464,7 -456,7 +466,7 @@@ self.display_error(result); return; } - self.notification.notify("Changed Password", "Password has been changed successfully"); + self.do_notify("Changed Password", "Password has been changed successfully"); }); } }); @@@ -472,7 -464,7 +474,7 @@@ }); openerp.web.Login = openerp.web.Widget.extend(/** @lends openerp.web.Login# */{ - remember_creditentials: true, + remember_credentials: true, template: "Login", identifier_prefix: 'oe-app-login-', @@@ -490,7 -482,7 +492,7 @@@ this.selected_db = null; this.selected_login = null; - if (this.has_local_storage && this.remember_creditentials) { + if (this.has_local_storage && this.remember_credentials) { this.selected_db = localStorage.getItem('last_db_login_success'); this.selected_login = localStorage.getItem('last_login_login_success'); if (jQuery.deparam(jQuery.param.querystring()).debug != undefined) { @@@ -556,7 -548,7 +558,7 @@@ this.session.session_login(db, login, password, function() { if(self.session.session_is_valid()) { if (self.has_local_storage) { - if(self.remember_creditentials) { + if(self.remember_credentials) { localStorage.setItem('last_db_login_success', db); localStorage.setItem('last_login_login_success', login); if (jQuery.deparam(jQuery.param.querystring()).debug != undefined) { @@@ -948,10 -940,13 +950,10 @@@ openerp.web.WebClient = openerp.web.Wid } this.$element.html(QWeb.render("Interface", params)); + this.notification = new openerp.web.Notification(); this.session = new openerp.web.Session(); this.loading = new openerp.web.Loading(this,"oe_loading"); this.crashmanager = new openerp.web.CrashManager(this); - this.crashmanager.start(); - - // Do you autorize this ? will be replaced by notify() in controller - openerp.web.Widget.prototype.notification = new openerp.web.Notification(this, "oe_notification"); this.header = new openerp.web.Header(this); this.login = new openerp.web.Login(this); @@@ -972,25 -967,11 +974,25 @@@ }, start: function() { + this._super.apply(this, arguments); + this.notification.prependTo(this.$element); this.header.appendTo($("#oe_header")); this.session.start(); this.login.appendTo($('#oe_login')); this.menu.start(); }, + do_reload: function() { + this.session.session_restore(); + this.menu.do_reload(); + }, + do_notify: function() { + var n = this.notification; + n.notify.apply(n, arguments); + }, + do_warn: function() { + var n = this.notification; + n.warn.apply(n, arguments); + }, on_logged: function() { this.menu.do_reload(); if(this.action_manager) @@@ -1079,8 -1060,7 +1081,8 @@@ this.action_manager.do_action(action); }, do_about: function() { - } + }, + }); };