summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome.js
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2012-12-17 12:38:42 +0100
committerFabien Meghazi <fme@openerp.com>2012-12-17 12:38:42 +0100
commitc1e9e6f12e343244f86fbf56bf4e5eb983b334d5 (patch)
tree25b700d47006479c71f36c6231a64619d6715574 /addons/web/static/src/js/chrome.js
parenta724c43257252e19a9bb37fca9a01aae0c8bf8f5 (diff)
parentc8b5413f371fde077c872a9b782b7b60394f5e0d (diff)
[MERGE] trunk
bzr revid: fme@openerp.com-20121217113842-j3a013i7xrsb5a69
Diffstat (limited to 'addons/web/static/src/js/chrome.js')
-rw-r--r--addons/web/static/src/js/chrome.js31
1 files changed, 20 insertions, 11 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index a6f75a5de6c..e3d5c9452f4 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -1139,6 +1139,8 @@ instance.web.WebClient = instance.web.Client.extend({
init: function(parent) {
this._super(parent);
this._current_state = null;
+ this.menu_dm = new instance.web.DropMisordered();
+ this.action_mutex = new $.Mutex();
},
start: function() {
var self = this;
@@ -1190,6 +1192,7 @@ instance.web.WebClient = instance.web.Client.extend({
show_application: function() {
var self = this;
self.toggle_bars(true);
+ self.update_logo();
self.menu = new instance.web.Menu(self);
self.menu.replace(this.$el.find('.oe_menu_placeholder'));
self.menu.on('menu_click', this, this.on_menu_action);
@@ -1201,6 +1204,10 @@ instance.web.WebClient = instance.web.Client.extend({
self.set_title();
self.check_timezone();
},
+ update_logo: function() {
+ var img = this.session.url('/web/binary/company_logo');
+ this.$el.find('.oe_logo img').attr('src', '').attr('src', img);
+ },
check_timezone: function() {
var self = this;
return new instance.web.Model('res.users').call('read', [[this.session.uid], ['tz_offset']]).then(function(result) {
@@ -1304,18 +1311,20 @@ instance.web.WebClient = instance.web.Client.extend({
},
on_menu_action: function(options) {
var self = this;
- return this.rpc("/web/action/load", { action_id: options.action_id })
+ return this.menu_dm.add(this.rpc("/web/action/load", { action_id: options.action_id }))
.then(function (result) {
- if (options.needaction) {
- result.context = new instance.web.CompoundContext(
- result.context,
- {search_default_message_unread: true});
- }
- return $.when(self.action_manager.do_action(result, {
- clear_breadcrumbs: true,
- action_menu_id: self.menu.current_menu,
- })).fail(function() {
- self.menu.open_menu(options.previous_menu_id);
+ return self.action_mutex.exec(function() {
+ if (options.needaction) {
+ result.context = new instance.web.CompoundContext(
+ result.context,
+ {search_default_message_unread: true});
+ }
+ return $.when(self.action_manager.do_action(result, {
+ clear_breadcrumbs: true,
+ action_menu_id: self.menu.current_menu,
+ })).fail(function() {
+ self.menu.open_menu(options.previous_menu_id);
+ });
});
});
},