summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/abstract_web_client.js12
-rw-r--r--addons/web/static/src/js/action_manager.js8
-rw-r--r--addons/web/static/src/js/web_client.js6
3 files changed, 19 insertions, 7 deletions
diff --git a/addons/web/static/src/js/abstract_web_client.js b/addons/web/static/src/js/abstract_web_client.js
index 31aa0d6f3dd..ea8db35d962 100644
--- a/addons/web/static/src/js/abstract_web_client.js
+++ b/addons/web/static/src/js/abstract_web_client.js
@@ -27,6 +27,9 @@ var WebClient = Widget.extend({
clear_uncommitted_changes: function (e) {
this.clear_uncommitted_changes().then(e.data.callback);
},
+ toggle_fullscreen: function (event) {
+ this.toggle_fullscreen(event.data.fullscreen);
+ },
},
init: function(parent, client_options) {
this.client_options = {};
@@ -103,9 +106,6 @@ var WebClient = Widget.extend({
self.$('.oe_dropdown_menu.oe_opened, .oe_dropdown_toggle.oe_opened').removeClass('oe_opened');
}
});
- core.bus.on('set_full_screen', this, function (full_screen) {
- this.set_content_full_screen(full_screen);
- });
core.bus.on('connection_lost', this, this.on_connection_lost);
core.bus.on('connection_restored', this, this.on_connection_restored);
@@ -233,10 +233,8 @@ var WebClient = Widget.extend({
//--------------------------------------------------------------
// Misc.
//--------------------------------------------------------------
- set_content_full_screen: function(fullscreen) {
- $(document.body).css('overflow-y', fullscreen ? 'hidden' : 'scroll');
- this.$('.oe_webclient').toggleClass(
- 'oe_content_full_screen', fullscreen);
+ toggle_fullscreen: function(fullscreen) {
+ this.$el.toggleClass('o_fullscreen', fullscreen);
},
});
diff --git a/addons/web/static/src/js/action_manager.js b/addons/web/static/src/js/action_manager.js
index be5e6c6c996..c7f79070e8c 100644
--- a/addons/web/static/src/js/action_manager.js
+++ b/addons/web/static/src/js/action_manager.js
@@ -320,6 +320,7 @@ var ActionManager = Widget.extend({
if (options.clear_breadcrumbs) {
self.clear_action_stack(old_action_stack);
}
+ self.toggle_fullscreen();
}).fail(function () {
// Destroy failed action and restore internal state
new_action.destroy();
@@ -416,6 +417,13 @@ var ActionManager = Widget.extend({
this.inner_action = null;
this.inner_widget = null;
}
+ this.toggle_fullscreen();
+ },
+ toggle_fullscreen: function() {
+ var is_fullscreen = _.some(this.action_stack, function(action) {
+ return action.action_descr.target === "fullscreen";
+ });
+ this.trigger_up("toggle_fullscreen", {fullscreen: is_fullscreen});
},
do_push_state: function(state) {
if (!this.webclient || this.dialog) {
diff --git a/addons/web/static/src/js/web_client.js b/addons/web/static/src/js/web_client.js
index 213aa70eed4..4ec80b60cc9 100644
--- a/addons/web/static/src/js/web_client.js
+++ b/addons/web/static/src/js/web_client.js
@@ -161,6 +161,12 @@ return AbstractWebClient.extend({
});
});
},
+ toggle_fullscreen: function(fullscreen) {
+ this._super(fullscreen);
+ if (!fullscreen) {
+ this.menu.reflow();
+ }
+ },
});
});