From 26dcbd7b09c11799eb1592f669e3c6c7c1c56807 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Fri, 1 May 2015 17:11:21 +0200 Subject: [PATCH 01/16] [ADD] web_hide_menu --- web_hide_menu/README.rst | 45 +++++ web_hide_menu/__init__.py | 20 +++ web_hide_menu/__openerp__.py | 41 +++++ web_hide_menu/data/ir_config_parameter.xml | 13 ++ web_hide_menu/static/description/icon.png | Bin 0 -> 3386 bytes .../static/src/css/web_hide_menu.css | 24 +++ web_hide_menu/static/src/js/web_hide_menu.js | 160 ++++++++++++++++++ web_hide_menu/views/templates.xml | 11 ++ 8 files changed, 314 insertions(+) create mode 100644 web_hide_menu/README.rst create mode 100644 web_hide_menu/__init__.py create mode 100644 web_hide_menu/__openerp__.py create mode 100644 web_hide_menu/data/ir_config_parameter.xml create mode 100644 web_hide_menu/static/description/icon.png create mode 100644 web_hide_menu/static/src/css/web_hide_menu.css create mode 100644 web_hide_menu/static/src/js/web_hide_menu.js create mode 100644 web_hide_menu/views/templates.xml diff --git a/web_hide_menu/README.rst b/web_hide_menu/README.rst new file mode 100644 index 000000000..d8b7dbadd --- /dev/null +++ b/web_hide_menu/README.rst @@ -0,0 +1,45 @@ +Hide menus +========== + +This addon hides the top menu bar and the left menu bar. They become visible again when you move the mouse towards the border of the screen (the distance is configurable). Moving the mouse out of a menu causes it to disappear after a configurable delay. + +Configuration +============= + +To configure this module, you need to: + +* go to Settings / Technical / Parameters / System Parameters +* adjust `web_hide_menu.show_bar_treshold` to set the distance in pixels from the border from which the menu appears +* adjust `web_hide_menu.hide_delay` to set the amount of milliseconds after which the menu disappears if the mouse left it + +Known issues / Roadmap +====================== + +* This module heavily relies on mouse events, so it probably messes things up for touchscreens + +Credits +======= + +Contributors +------------ + +* Holger Brunn + +Icon +---- + +* http://commons.wikimedia.org/wiki/File:VisualEditor_-_Icon_-_Menu.svg +* http://commons.wikimedia.org/wiki/File:ProhibitionSign2.svg + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/web_hide_menu/__init__.py b/web_hide_menu/__init__.py new file mode 100644 index 000000000..faef9dac0 --- /dev/null +++ b/web_hide_menu/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Therp BV . +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## diff --git a/web_hide_menu/__openerp__.py b/web_hide_menu/__openerp__.py new file mode 100644 index 000000000..757953023 --- /dev/null +++ b/web_hide_menu/__openerp__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Therp BV . +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{ + "name": "Hide menus", + "version": "1.0", + "author": "Therp BV", + "license": "AGPL-3", + "category": "Tools", + "summary": "Hide top and left menu bar", + "depends": [ + 'web', + ], + "data": [ + "data/ir_config_parameter.xml", + 'views/templates.xml', + ], + "auto_install": False, + "installable": True, + "application": False, + "external_dependencies": { + 'python': [], + }, +} diff --git a/web_hide_menu/data/ir_config_parameter.xml b/web_hide_menu/data/ir_config_parameter.xml new file mode 100644 index 000000000..9f2a543e4 --- /dev/null +++ b/web_hide_menu/data/ir_config_parameter.xml @@ -0,0 +1,13 @@ + + + + + web_hide_menu.show_bar_treshold + 10 + + + web_hide_menu.hide_delay + 10000 + + + diff --git a/web_hide_menu/static/description/icon.png b/web_hide_menu/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cd538f1e75b8f77a06e430801a1ab733a22ab408 GIT binary patch literal 3386 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 literal 0 HcmV?d00001 diff --git a/web_hide_menu/static/src/css/web_hide_menu.css b/web_hide_menu/static/src/css/web_hide_menu.css new file mode 100644 index 000000000..8c34a2ddc --- /dev/null +++ b/web_hide_menu/static/src/css/web_hide_menu.css @@ -0,0 +1,24 @@ +.openerp.openerp_webclient_container +{ + height: 100%; +} +.oe_leftbar +{ + display: block; + position: absolute; + left: 0px; + top: 0px; + bottom: 0px; + z-index: 100; +} +.openerp .oe_leftbar > div +{ + width: 100%; +} +#oe_main_menu_navbar +{ + position: absolute; + left: 0px; + right: 0px; + top: 0px; +} diff --git a/web_hide_menu/static/src/js/web_hide_menu.js b/web_hide_menu/static/src/js/web_hide_menu.js new file mode 100644 index 000000000..83b1479fd --- /dev/null +++ b/web_hide_menu/static/src/js/web_hide_menu.js @@ -0,0 +1,160 @@ +//-*- coding: utf-8 -*- +//############################################################################ +// +// OpenERP, Open Source Management Solution +// This module copyright (C) 2015 Therp BV . +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// +//############################################################################ + +openerp.web_hide_menu = function(instance) +{ + instance.web.WebClient.include({ + show_bar_treshold: 10, + hide_delay: 10000, + leftbar_hide_timeout_id: null, + main_menu_hide_timeout_id: null, + start: function() + { + var self = this; + return this._super.apply(this, arguments) + .then(function() + { + var addon_name = 'web_hide_menu', + parameters = _.map( + ['show_bar_treshold', 'hide_delay'], + function(a) { return addon_name + '.' + a }); + return (new openerp.web.Model('ir.config_parameter')) + .query(['key', 'value']) + .filter([['key', 'in', parameters]]) + .all() + .then(function(params) + { + _.each(params, function(param) + { + self[param.key.replace(addon_name + '.', '')] = + parseInt(param.value); + }); + }); + }) + .then(function() + { + self.$el + .bind('mousemove', _.bind(self.on_mousemove, self)); + }) + }, + show_application: function() + { + this._super.apply(this, arguments); + openerp.client.toggle_main_menu(false, this.hide_delay); + }, + toggle_bars: function(hide) + { + this.toggle_main_menu(hide); + this.toggle_left_bar(hide); + }, + toggle_menu_element(selector, timeout_id, show, delay) + { + if(this[timeout_id]) + { + clearTimeout(this[timeout_id]); + this[timeout_id] = null; + } + if(delay) + { + this[timeout_id] = setTimeout( + _.bind( + this.toggle_menu_element, this, + selector, timeout_id, show), + delay); + } + else + { + this.$(selector).toggle(show); + } + }, + toggle_main_menu: function(show, delay) + { + this.toggle_menu_element( + '#oe_main_menu_navbar', 'main_menu_hide_timeout_id', show, + delay); + }, + toggle_left_bar: function(show, delay) + { + this.toggle_menu_element( + '.oe_leftbar', 'leftbar_hide_timeout_id', show, delay); + }, + on_mousemove: function(e) + { + var on_main_menu = jQuery(e.srcElement) + .parents('#oe_main_menu_navbar').length > 0, + on_left_bar = jQuery(e.srcElement) + .parents('.oe_leftbar').length > 0; + if(on_left_bar && openerp.client.leftbar_hide_timeout_id) + { + clearTimeout(openerp.client.leftbar_hide_timeout_id); + openerp.client.leftbar_hide_timeout_id = null; + } + if(on_main_menu && openerp.client.main_menu_hide_timeout_id) + { + clearTimeout(openerp.client.main_menu_hide_timeout_id); + openerp.client.main_menu_hide_timeout_id = null; + } + if(!on_left_bar && !openerp.client.leftbar_hide_timeout_id) + { + this.toggle_left_bar(false, openerp.client.hide_delay); + } + if(!on_main_menu && !openerp.client.main_menu_hide_timeout_id) + { + this.toggle_main_menu(false); + } + if(e.pageX < this.show_bar_treshold) + { + this.toggle_left_bar(true); + } + if(e.pageY < this.show_bar_treshold) + { + this.toggle_main_menu(true); + } + }, + }); + instance.web.Menu.include({ + start: function() + { + this.on('menu_click', this, this.on_menu_click_with_action); + openerp.client.toggle_left_bar(false, openerp.client.hide_delay); + return this._super.apply(this, arguments); + }, + on_top_menu_click: function() + { + this.top_menu_click = true; + return this._super.apply(this, arguments); + }, + on_menu_click_with_action: function() + { + this.close_menu = !this.top_menu_click; + this.top_menu_click = false; + }, + open_menu: function() + { + this._super.apply(this, arguments); + if(this.close_menu) + { + openerp.client.toggle_left_bar(false); + } + this.close_menu = false; + }, + }); +} diff --git a/web_hide_menu/views/templates.xml b/web_hide_menu/views/templates.xml new file mode 100644 index 000000000..36f915374 --- /dev/null +++ b/web_hide_menu/views/templates.xml @@ -0,0 +1,11 @@ + + + + + + From 2ae92c921288ec4eafd93b7550f655c84156705a Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Fri, 1 May 2015 17:31:23 +0200 Subject: [PATCH 02/16] [ADD] have left bar autosize to content --- web_hide_menu/static/src/css/web_hide_menu.css | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/web_hide_menu/static/src/css/web_hide_menu.css b/web_hide_menu/static/src/css/web_hide_menu.css index 8c34a2ddc..4af999f3d 100644 --- a/web_hide_menu/static/src/css/web_hide_menu.css +++ b/web_hide_menu/static/src/css/web_hide_menu.css @@ -2,7 +2,7 @@ { height: 100%; } -.oe_leftbar +.openerp .oe_leftbar { display: block; position: absolute; @@ -10,10 +10,19 @@ top: 0px; bottom: 0px; z-index: 100; + width: auto; } .openerp .oe_leftbar > div { - width: 100%; + width: auto; +} +.openerp .oe_leftbar > div > div > div +{ + overflow-y: auto; +} +.openerp .oe_leftbar > div > div > div > div.oe_secondary_menus_container +{ + position: static; } #oe_main_menu_navbar { From 6289b681c81265ba3c7dcddc587b4c475dc6bc0d Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Fri, 1 May 2015 17:57:51 +0200 Subject: [PATCH 03/16] [IMP] decide whether to close the sidebar in a smarter way --- web_hide_menu/static/src/js/web_hide_menu.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/web_hide_menu/static/src/js/web_hide_menu.js b/web_hide_menu/static/src/js/web_hide_menu.js index 83b1479fd..a8b957e7b 100644 --- a/web_hide_menu/static/src/js/web_hide_menu.js +++ b/web_hide_menu/static/src/js/web_hide_menu.js @@ -131,30 +131,29 @@ openerp.web_hide_menu = function(instance) }, }); instance.web.Menu.include({ + close_leftbar: false, start: function() { this.on('menu_click', this, this.on_menu_click_with_action); openerp.client.toggle_left_bar(false, openerp.client.hide_delay); return this._super.apply(this, arguments); }, - on_top_menu_click: function() + on_menu_click_with_action: function(menu, $element) { - this.top_menu_click = true; - return this._super.apply(this, arguments); - }, - on_menu_click_with_action: function() - { - this.close_menu = !this.top_menu_click; - this.top_menu_click = false; + //close if it's not a menu containing other menus + this.close_leftbar = ( + $element.parents('#oe_main_menu_navbar').length == 0 && + $element.parent().children('ul').length == 0 + ); }, open_menu: function() { this._super.apply(this, arguments); - if(this.close_menu) + if(this.close_leftbar) { openerp.client.toggle_left_bar(false); } - this.close_menu = false; + this.close_leftbar = false; }, }); } From 8a73c90a16c10cef6b330a919e3e25c9a60cc38b Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 4 May 2015 09:38:14 +0200 Subject: [PATCH 04/16] [REN] rename the module and adapt README.rst --- {web_hide_menu => web_menu_autohide}/README.rst | 6 +++--- {web_hide_menu => web_menu_autohide}/__init__.py | 0 {web_hide_menu => web_menu_autohide}/__openerp__.py | 0 .../data/ir_config_parameter.xml | 0 .../static/description/icon.png | Bin .../static/src/css/web_hide_menu.css | 0 .../static/src/js/web_hide_menu.js | 0 .../views/templates.xml | 0 8 files changed, 3 insertions(+), 3 deletions(-) rename {web_hide_menu => web_menu_autohide}/README.rst (72%) rename {web_hide_menu => web_menu_autohide}/__init__.py (100%) rename {web_hide_menu => web_menu_autohide}/__openerp__.py (100%) rename {web_hide_menu => web_menu_autohide}/data/ir_config_parameter.xml (100%) rename {web_hide_menu => web_menu_autohide}/static/description/icon.png (100%) rename {web_hide_menu => web_menu_autohide}/static/src/css/web_hide_menu.css (100%) rename {web_hide_menu => web_menu_autohide}/static/src/js/web_hide_menu.js (100%) rename {web_hide_menu => web_menu_autohide}/views/templates.xml (100%) diff --git a/web_hide_menu/README.rst b/web_menu_autohide/README.rst similarity index 72% rename from web_hide_menu/README.rst rename to web_menu_autohide/README.rst index d8b7dbadd..d967d86d5 100644 --- a/web_hide_menu/README.rst +++ b/web_menu_autohide/README.rst @@ -1,7 +1,7 @@ Hide menus ========== -This addon hides the top menu bar and the left menu bar. They become visible again when you move the mouse towards the border of the screen (the distance is configurable). Moving the mouse out of a menu causes it to disappear after a configurable delay. +This addon hides the top and left menu bars. They become visible again when you move the mouse towards the border of the screen (the distance is configurable). Moving the mouse out of a menu causes it to disappear after a configurable delay. Configuration ============= @@ -9,8 +9,8 @@ Configuration To configure this module, you need to: * go to Settings / Technical / Parameters / System Parameters -* adjust `web_hide_menu.show_bar_treshold` to set the distance in pixels from the border from which the menu appears -* adjust `web_hide_menu.hide_delay` to set the amount of milliseconds after which the menu disappears if the mouse left it +* adjust `web_hide_menu.show_bar_treshold` to set the distance in pixels from the border from which the menu appears (default is 10 pixels) +* adjust `web_hide_menu.hide_delay` to set the amount of milliseconds after which the menu disappears if the mouse left it (default is 10 seconds) Known issues / Roadmap ====================== diff --git a/web_hide_menu/__init__.py b/web_menu_autohide/__init__.py similarity index 100% rename from web_hide_menu/__init__.py rename to web_menu_autohide/__init__.py diff --git a/web_hide_menu/__openerp__.py b/web_menu_autohide/__openerp__.py similarity index 100% rename from web_hide_menu/__openerp__.py rename to web_menu_autohide/__openerp__.py diff --git a/web_hide_menu/data/ir_config_parameter.xml b/web_menu_autohide/data/ir_config_parameter.xml similarity index 100% rename from web_hide_menu/data/ir_config_parameter.xml rename to web_menu_autohide/data/ir_config_parameter.xml diff --git a/web_hide_menu/static/description/icon.png b/web_menu_autohide/static/description/icon.png similarity index 100% rename from web_hide_menu/static/description/icon.png rename to web_menu_autohide/static/description/icon.png diff --git a/web_hide_menu/static/src/css/web_hide_menu.css b/web_menu_autohide/static/src/css/web_hide_menu.css similarity index 100% rename from web_hide_menu/static/src/css/web_hide_menu.css rename to web_menu_autohide/static/src/css/web_hide_menu.css diff --git a/web_hide_menu/static/src/js/web_hide_menu.js b/web_menu_autohide/static/src/js/web_hide_menu.js similarity index 100% rename from web_hide_menu/static/src/js/web_hide_menu.js rename to web_menu_autohide/static/src/js/web_hide_menu.js diff --git a/web_hide_menu/views/templates.xml b/web_menu_autohide/views/templates.xml similarity index 100% rename from web_hide_menu/views/templates.xml rename to web_menu_autohide/views/templates.xml From 5823fc489813534eab809ec3f33f97e7546d5f61 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 4 May 2015 12:19:57 +0200 Subject: [PATCH 05/16] [FIX] rename all references to web_hide_menu --- web_menu_autohide/data/ir_config_parameter.xml | 4 ++-- .../src/css/{web_hide_menu.css => web_menu_autohide.css} | 0 .../static/src/js/{web_hide_menu.js => web_menu_autohide.js} | 2 +- web_menu_autohide/views/templates.xml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename web_menu_autohide/static/src/css/{web_hide_menu.css => web_menu_autohide.css} (100%) rename web_menu_autohide/static/src/js/{web_hide_menu.js => web_menu_autohide.js} (99%) diff --git a/web_menu_autohide/data/ir_config_parameter.xml b/web_menu_autohide/data/ir_config_parameter.xml index 9f2a543e4..92f7ac2f4 100644 --- a/web_menu_autohide/data/ir_config_parameter.xml +++ b/web_menu_autohide/data/ir_config_parameter.xml @@ -2,11 +2,11 @@ - web_hide_menu.show_bar_treshold + web_menu_autohide.show_bar_treshold 10 - web_hide_menu.hide_delay + web_menu_autohide.hide_delay 10000 diff --git a/web_menu_autohide/static/src/css/web_hide_menu.css b/web_menu_autohide/static/src/css/web_menu_autohide.css similarity index 100% rename from web_menu_autohide/static/src/css/web_hide_menu.css rename to web_menu_autohide/static/src/css/web_menu_autohide.css diff --git a/web_menu_autohide/static/src/js/web_hide_menu.js b/web_menu_autohide/static/src/js/web_menu_autohide.js similarity index 99% rename from web_menu_autohide/static/src/js/web_hide_menu.js rename to web_menu_autohide/static/src/js/web_menu_autohide.js index a8b957e7b..105544076 100644 --- a/web_menu_autohide/static/src/js/web_hide_menu.js +++ b/web_menu_autohide/static/src/js/web_menu_autohide.js @@ -32,7 +32,7 @@ openerp.web_hide_menu = function(instance) return this._super.apply(this, arguments) .then(function() { - var addon_name = 'web_hide_menu', + var addon_name = 'web_menu_autohide', parameters = _.map( ['show_bar_treshold', 'hide_delay'], function(a) { return addon_name + '.' + a }); diff --git a/web_menu_autohide/views/templates.xml b/web_menu_autohide/views/templates.xml index 36f915374..01ebb6e1c 100644 --- a/web_menu_autohide/views/templates.xml +++ b/web_menu_autohide/views/templates.xml @@ -3,8 +3,8 @@ From 9e405277a216f935aec3d6b268eade7c4d37702f Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 4 May 2015 12:21:00 +0200 Subject: [PATCH 06/16] [FIX] rename more references --- web_menu_autohide/README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_menu_autohide/README.rst b/web_menu_autohide/README.rst index d967d86d5..883e00305 100644 --- a/web_menu_autohide/README.rst +++ b/web_menu_autohide/README.rst @@ -9,8 +9,8 @@ Configuration To configure this module, you need to: * go to Settings / Technical / Parameters / System Parameters -* adjust `web_hide_menu.show_bar_treshold` to set the distance in pixels from the border from which the menu appears (default is 10 pixels) -* adjust `web_hide_menu.hide_delay` to set the amount of milliseconds after which the menu disappears if the mouse left it (default is 10 seconds) +* adjust `web_menu_autohide.show_bar_treshold` to set the distance in pixels from the border from which the menu appears (default is 10 pixels) +* adjust `web_menu_autohide.hide_delay` to set the amount of milliseconds after which the menu disappears if the mouse left it (default is 10 seconds) Known issues / Roadmap ====================== From 32e70a0fdc881c2d0df3a81ccbd57abc283dcc89 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 4 May 2015 13:15:55 +0200 Subject: [PATCH 07/16] [FIX] more renaming woes --- web_menu_autohide/static/src/js/web_menu_autohide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_menu_autohide/static/src/js/web_menu_autohide.js b/web_menu_autohide/static/src/js/web_menu_autohide.js index 105544076..1cb074009 100644 --- a/web_menu_autohide/static/src/js/web_menu_autohide.js +++ b/web_menu_autohide/static/src/js/web_menu_autohide.js @@ -19,7 +19,7 @@ // //############################################################################ -openerp.web_hide_menu = function(instance) +openerp.web_menu_autohide = function(instance) { instance.web.WebClient.include({ show_bar_treshold: 10, From feaf1060a5af6389bbfb6e6c30b32e408d3d0529 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 4 May 2015 13:56:38 +0200 Subject: [PATCH 08/16] [FIX] scroll menu in firefox --- web_menu_autohide/static/src/css/web_menu_autohide.css | 8 -------- 1 file changed, 8 deletions(-) diff --git a/web_menu_autohide/static/src/css/web_menu_autohide.css b/web_menu_autohide/static/src/css/web_menu_autohide.css index 4af999f3d..4d9b4e589 100644 --- a/web_menu_autohide/static/src/css/web_menu_autohide.css +++ b/web_menu_autohide/static/src/css/web_menu_autohide.css @@ -16,14 +16,6 @@ { width: auto; } -.openerp .oe_leftbar > div > div > div -{ - overflow-y: auto; -} -.openerp .oe_leftbar > div > div > div > div.oe_secondary_menus_container -{ - position: static; -} #oe_main_menu_navbar { position: absolute; From 5c96d8895380ed21d79a524c6389a9cc43fb9c5a Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Tue, 5 May 2015 08:15:44 +0200 Subject: [PATCH 09/16] [ADD] allow to close left menu by clicking somwhere else --- .../static/src/js/web_menu_autohide.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/web_menu_autohide/static/src/js/web_menu_autohide.js b/web_menu_autohide/static/src/js/web_menu_autohide.js index 1cb074009..fd4e40deb 100644 --- a/web_menu_autohide/static/src/js/web_menu_autohide.js +++ b/web_menu_autohide/static/src/js/web_menu_autohide.js @@ -52,7 +52,8 @@ openerp.web_menu_autohide = function(instance) .then(function() { self.$el - .bind('mousemove', _.bind(self.on_mousemove, self)); + .bind('mousemove', _.bind(self.on_mousemove, self)) + .bind('click', _.bind(self.on_click, self)); }) }, show_application: function() @@ -96,6 +97,19 @@ openerp.web_menu_autohide = function(instance) this.toggle_menu_element( '.oe_leftbar', 'leftbar_hide_timeout_id', show, delay); }, + on_click: function(e) + { + var on_main_menu = jQuery(e.srcElement) + .parents('#oe_main_menu_navbar').length > 0, + on_left_bar = jQuery(e.srcElement) + .parents('.oe_leftbar').length > 0; + if(!on_left_bar && !on_main_menu && openerp.client.leftbar_hide_timeout_id) + { + clearTimeout(openerp.client.leftbar_hide_timeout_id); + openerp.client.leftbar_hide_timeout_id = null; + this.toggle_left_bar(false); + } + }, on_mousemove: function(e) { var on_main_menu = jQuery(e.srcElement) From ea8e8b5caf768ce5866632ad607f9b2a26b682d4 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 6 May 2015 11:27:57 +0200 Subject: [PATCH 10/16] [FIX] correct js syntax --- web_menu_autohide/static/src/js/web_menu_autohide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_menu_autohide/static/src/js/web_menu_autohide.js b/web_menu_autohide/static/src/js/web_menu_autohide.js index fd4e40deb..22aa062be 100644 --- a/web_menu_autohide/static/src/js/web_menu_autohide.js +++ b/web_menu_autohide/static/src/js/web_menu_autohide.js @@ -66,7 +66,7 @@ openerp.web_menu_autohide = function(instance) this.toggle_main_menu(hide); this.toggle_left_bar(hide); }, - toggle_menu_element(selector, timeout_id, show, delay) + toggle_menu_element: function(selector, timeout_id, show, delay) { if(this[timeout_id]) { From 257ed3b7d44a456bdee9081ecb90879ff7c36b4a Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 6 May 2015 11:37:20 +0200 Subject: [PATCH 11/16] [FIX] use jquery api --- web_menu_autohide/static/src/js/web_menu_autohide.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web_menu_autohide/static/src/js/web_menu_autohide.js b/web_menu_autohide/static/src/js/web_menu_autohide.js index 22aa062be..a3e343fea 100644 --- a/web_menu_autohide/static/src/js/web_menu_autohide.js +++ b/web_menu_autohide/static/src/js/web_menu_autohide.js @@ -99,9 +99,9 @@ openerp.web_menu_autohide = function(instance) }, on_click: function(e) { - var on_main_menu = jQuery(e.srcElement) + var on_main_menu = jQuery(e.target) .parents('#oe_main_menu_navbar').length > 0, - on_left_bar = jQuery(e.srcElement) + on_left_bar = jQuery(e.target) .parents('.oe_leftbar').length > 0; if(!on_left_bar && !on_main_menu && openerp.client.leftbar_hide_timeout_id) { @@ -112,9 +112,9 @@ openerp.web_menu_autohide = function(instance) }, on_mousemove: function(e) { - var on_main_menu = jQuery(e.srcElement) + var on_main_menu = jQuery(e.target) .parents('#oe_main_menu_navbar').length > 0, - on_left_bar = jQuery(e.srcElement) + on_left_bar = jQuery(e.target) .parents('.oe_leftbar').length > 0; if(on_left_bar && openerp.client.leftbar_hide_timeout_id) { From f94a1f963585600555b369df39e8c62afd884b9c Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Tue, 12 May 2015 12:40:51 +0200 Subject: [PATCH 12/16] [IMP] put menu over block_ui layer --- web_menu_autohide/static/src/css/web_menu_autohide.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web_menu_autohide/static/src/css/web_menu_autohide.css b/web_menu_autohide/static/src/css/web_menu_autohide.css index 4d9b4e589..73773cd5b 100644 --- a/web_menu_autohide/static/src/css/web_menu_autohide.css +++ b/web_menu_autohide/static/src/css/web_menu_autohide.css @@ -9,7 +9,7 @@ left: 0px; top: 0px; bottom: 0px; - z-index: 100; + z-index: 1110; width: auto; } .openerp .oe_leftbar > div @@ -22,4 +22,5 @@ left: 0px; right: 0px; top: 0px; + z-index: 1110; } From 9a74ec4ec637fdabfb18538d70e81872493c8774 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Tue, 2 Jun 2015 08:55:03 +0200 Subject: [PATCH 13/16] [IMP] allow to hide left bar and top bar independently --- web_menu_autohide/README.rst | 4 +- .../data/ir_config_parameter.xml | 16 +++- .../static/src/css/web_menu_autohide.css | 26 ------ .../static/src/js/web_menu_autohide.js | 81 ++++++++++++++----- web_menu_autohide/views/templates.xml | 1 - 5 files changed, 77 insertions(+), 51 deletions(-) delete mode 100644 web_menu_autohide/static/src/css/web_menu_autohide.css diff --git a/web_menu_autohide/README.rst b/web_menu_autohide/README.rst index 883e00305..94729385d 100644 --- a/web_menu_autohide/README.rst +++ b/web_menu_autohide/README.rst @@ -9,8 +9,8 @@ Configuration To configure this module, you need to: * go to Settings / Technical / Parameters / System Parameters -* adjust `web_menu_autohide.show_bar_treshold` to set the distance in pixels from the border from which the menu appears (default is 10 pixels) -* adjust `web_menu_autohide.hide_delay` to set the amount of milliseconds after which the menu disappears if the mouse left it (default is 10 seconds) +* adjust `web_menu_autohide.show_bar_threshold_navbar` and `web_menu_autohide.show_bar_threshold_leftbar` to set the distance in pixels from the border from which the menu appears (default is 10 pixels, a value of `0` disables hiding) +* adjust `web_menu_autohide.hide_delay_navbar` and `web_menu_autohide.hide_delay_leftbar` to set the amount of milliseconds after which the menu disappears if the mouse left it (default is 10 seconds) Known issues / Roadmap ====================== diff --git a/web_menu_autohide/data/ir_config_parameter.xml b/web_menu_autohide/data/ir_config_parameter.xml index 92f7ac2f4..493cd2065 100644 --- a/web_menu_autohide/data/ir_config_parameter.xml +++ b/web_menu_autohide/data/ir_config_parameter.xml @@ -1,12 +1,20 @@ - - web_menu_autohide.show_bar_treshold + + web_menu_autohide.show_bar_threshold_navbar 10 - - web_menu_autohide.hide_delay + + web_menu_autohide.show_bar_threshold_leftbar + 10 + + + web_menu_autohide.hide_delay_navbar + 10000 + + + web_menu_autohide.hide_delay_leftbar 10000 diff --git a/web_menu_autohide/static/src/css/web_menu_autohide.css b/web_menu_autohide/static/src/css/web_menu_autohide.css deleted file mode 100644 index 73773cd5b..000000000 --- a/web_menu_autohide/static/src/css/web_menu_autohide.css +++ /dev/null @@ -1,26 +0,0 @@ -.openerp.openerp_webclient_container -{ - height: 100%; -} -.openerp .oe_leftbar -{ - display: block; - position: absolute; - left: 0px; - top: 0px; - bottom: 0px; - z-index: 1110; - width: auto; -} -.openerp .oe_leftbar > div -{ - width: auto; -} -#oe_main_menu_navbar -{ - position: absolute; - left: 0px; - right: 0px; - top: 0px; - z-index: 1110; -} diff --git a/web_menu_autohide/static/src/js/web_menu_autohide.js b/web_menu_autohide/static/src/js/web_menu_autohide.js index a3e343fea..4b3674c81 100644 --- a/web_menu_autohide/static/src/js/web_menu_autohide.js +++ b/web_menu_autohide/static/src/js/web_menu_autohide.js @@ -22,10 +22,14 @@ openerp.web_menu_autohide = function(instance) { instance.web.WebClient.include({ - show_bar_treshold: 10, - hide_delay: 10000, + show_bar_threshold_navbar: 10, + show_bar_threshold_leftbar: 10, + hide_delay_navbar: 10000, + hide_delay_leftbar: 10000, leftbar_hide_timeout_id: null, main_menu_hide_timeout_id: null, + navbar_query: '#oe_main_menu_navbar', + leftbar_query: '.oe_leftbar', start: function() { var self = this; @@ -34,7 +38,9 @@ openerp.web_menu_autohide = function(instance) { var addon_name = 'web_menu_autohide', parameters = _.map( - ['show_bar_treshold', 'hide_delay'], + ['show_bar_threshold_navbar', 'hide_delay_navbar', + 'show_bar_threshold_leftbar', 'hide_delay_leftbar', + ], function(a) { return addon_name + '.' + a }); return (new openerp.web.Model('ir.config_parameter')) .query(['key', 'value']) @@ -51,15 +57,46 @@ openerp.web_menu_autohide = function(instance) }) .then(function() { - self.$el - .bind('mousemove', _.bind(self.on_mousemove, self)) - .bind('click', _.bind(self.on_click, self)); + if(self.hide_delay_navbar) + { + jQuery('.openerp.openerp_webclient_container') + .css('height', '100%'); + jQuery(self.navbar_query) + .css({ + position: 'absolute', + left: '0px', + right: '0px', + top: '0px', + 'z-index': 1110 + }); + } + if(self.hide_delay_leftbar) + { + jQuery(self.leftbar_query) + .css({ + display: 'block', + position: 'absolute', + left: '0px', + top: '0px', + bottom: '0px', + 'z-index': 1110, + width: 'auto', + }); + jQuery('.openerp .oe_leftbar > div') + .css('width', 'auto'); + } + if(self.hide_delay_navbar || self.hide_delay_leftbar) + { + self.$el + .bind('mousemove', _.bind(self.on_mousemove, self)) + .bind('click', _.bind(self.on_click, self)); + } }) }, show_application: function() { this._super.apply(this, arguments); - openerp.client.toggle_main_menu(false, this.hide_delay); + openerp.client.toggle_main_menu(false, this.hide_delay_navbar); }, toggle_bars: function(hide) { @@ -88,21 +125,29 @@ openerp.web_menu_autohide = function(instance) }, toggle_main_menu: function(show, delay) { + if(!this.hide_delay_navbar) + { + return; + } this.toggle_menu_element( - '#oe_main_menu_navbar', 'main_menu_hide_timeout_id', show, + this.navbar_query, 'main_menu_hide_timeout_id', show, delay); }, toggle_left_bar: function(show, delay) { + if(!this.hide_delay_leftbar) + { + return; + } this.toggle_menu_element( - '.oe_leftbar', 'leftbar_hide_timeout_id', show, delay); + this.leftbar_query, 'leftbar_hide_timeout_id', show, delay); }, on_click: function(e) { var on_main_menu = jQuery(e.target) - .parents('#oe_main_menu_navbar').length > 0, + .parents(this.navbar_query).length > 0, on_left_bar = jQuery(e.target) - .parents('.oe_leftbar').length > 0; + .parents(this.leftbar_query).length > 0; if(!on_left_bar && !on_main_menu && openerp.client.leftbar_hide_timeout_id) { clearTimeout(openerp.client.leftbar_hide_timeout_id); @@ -113,9 +158,9 @@ openerp.web_menu_autohide = function(instance) on_mousemove: function(e) { var on_main_menu = jQuery(e.target) - .parents('#oe_main_menu_navbar').length > 0, + .parents(this.navbar_query).length > 0, on_left_bar = jQuery(e.target) - .parents('.oe_leftbar').length > 0; + .parents(this.leftbar_query).length > 0; if(on_left_bar && openerp.client.leftbar_hide_timeout_id) { clearTimeout(openerp.client.leftbar_hide_timeout_id); @@ -128,17 +173,17 @@ openerp.web_menu_autohide = function(instance) } if(!on_left_bar && !openerp.client.leftbar_hide_timeout_id) { - this.toggle_left_bar(false, openerp.client.hide_delay); + this.toggle_left_bar(false, openerp.client.hide_delay_leftbar); } if(!on_main_menu && !openerp.client.main_menu_hide_timeout_id) { this.toggle_main_menu(false); } - if(e.pageX < this.show_bar_treshold) + if(e.pageX < this.show_bar_threshold_leftbar) { this.toggle_left_bar(true); } - if(e.pageY < this.show_bar_treshold) + if(e.pageY < this.show_bar_threshold_navbar) { this.toggle_main_menu(true); } @@ -149,14 +194,14 @@ openerp.web_menu_autohide = function(instance) start: function() { this.on('menu_click', this, this.on_menu_click_with_action); - openerp.client.toggle_left_bar(false, openerp.client.hide_delay); + openerp.client.toggle_left_bar(false, openerp.client.hide_delay_leftbar); return this._super.apply(this, arguments); }, on_menu_click_with_action: function(menu, $element) { //close if it's not a menu containing other menus this.close_leftbar = ( - $element.parents('#oe_main_menu_navbar').length == 0 && + $element.parents(openerp.client.leftbar_query).length == 0 && $element.parent().children('ul').length == 0 ); }, diff --git a/web_menu_autohide/views/templates.xml b/web_menu_autohide/views/templates.xml index 01ebb6e1c..e6d8bf637 100644 --- a/web_menu_autohide/views/templates.xml +++ b/web_menu_autohide/views/templates.xml @@ -4,7 +4,6 @@ From 19e0c9759add6886b34b9ed04bdc38d5a2ae5cbf Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Tue, 2 Jun 2015 15:44:14 +0200 Subject: [PATCH 14/16] [FIX] timing issue with static main menu --- .../static/src/js/web_menu_autohide.js | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/web_menu_autohide/static/src/js/web_menu_autohide.js b/web_menu_autohide/static/src/js/web_menu_autohide.js index 4b3674c81..a5bc52cb1 100644 --- a/web_menu_autohide/static/src/js/web_menu_autohide.js +++ b/web_menu_autohide/static/src/js/web_menu_autohide.js @@ -32,29 +32,26 @@ openerp.web_menu_autohide = function(instance) leftbar_query: '.oe_leftbar', start: function() { - var self = this; - return this._super.apply(this, arguments) - .then(function() + var self = this, + addon_name = 'web_menu_autohide', + parameters = _.map( + ['show_bar_threshold_navbar', 'hide_delay_navbar', + 'show_bar_threshold_leftbar', 'hide_delay_leftbar', + ], + function(a) { return addon_name + '.' + a }); + return (new openerp.web.Model('ir.config_parameter')) + .query(['key', 'value']) + .filter([['key', 'in', parameters]]) + .all() + .then(function(params) { - var addon_name = 'web_menu_autohide', - parameters = _.map( - ['show_bar_threshold_navbar', 'hide_delay_navbar', - 'show_bar_threshold_leftbar', 'hide_delay_leftbar', - ], - function(a) { return addon_name + '.' + a }); - return (new openerp.web.Model('ir.config_parameter')) - .query(['key', 'value']) - .filter([['key', 'in', parameters]]) - .all() - .then(function(params) + _.each(params, function(param) { - _.each(params, function(param) - { - self[param.key.replace(addon_name + '.', '')] = - parseInt(param.value); - }); + self[param.key.replace(addon_name + '.', '')] = + parseInt(param.value); }); }) + .then(this.proxy(this._super)) .then(function() { if(self.hide_delay_navbar) From 32927dd164cca504e15d3c655210e9d98b9fe612 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 3 Jun 2015 07:12:35 +0200 Subject: [PATCH 15/16] [FIX] keep left menu open when opening a new submenu --- web_menu_autohide/static/src/js/web_menu_autohide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_menu_autohide/static/src/js/web_menu_autohide.js b/web_menu_autohide/static/src/js/web_menu_autohide.js index a5bc52cb1..683e07878 100644 --- a/web_menu_autohide/static/src/js/web_menu_autohide.js +++ b/web_menu_autohide/static/src/js/web_menu_autohide.js @@ -198,7 +198,7 @@ openerp.web_menu_autohide = function(instance) { //close if it's not a menu containing other menus this.close_leftbar = ( - $element.parents(openerp.client.leftbar_query).length == 0 && + $element.parents(openerp.client.navbar_query).length == 0 && $element.parent().children('ul').length == 0 ); }, From ffb3586582d67048cf4cde26a6b0bcaa83893d7c Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 31 Aug 2015 14:01:23 +0200 Subject: [PATCH 16/16] [FIX] simplify code --- web_menu_autohide/static/src/js/web_menu_autohide.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web_menu_autohide/static/src/js/web_menu_autohide.js b/web_menu_autohide/static/src/js/web_menu_autohide.js index 683e07878..a9829e68b 100644 --- a/web_menu_autohide/static/src/js/web_menu_autohide.js +++ b/web_menu_autohide/static/src/js/web_menu_autohide.js @@ -145,10 +145,8 @@ openerp.web_menu_autohide = function(instance) .parents(this.navbar_query).length > 0, on_left_bar = jQuery(e.target) .parents(this.leftbar_query).length > 0; - if(!on_left_bar && !on_main_menu && openerp.client.leftbar_hide_timeout_id) + if(!on_left_bar && !on_main_menu) { - clearTimeout(openerp.client.leftbar_hide_timeout_id); - openerp.client.leftbar_hide_timeout_id = null; this.toggle_left_bar(false); } },