diff options
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/action_manager.js | 5 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_manager.js | 16 | ||||
| -rw-r--r-- | addons/web/static/src/js/widgets/user_menu.js | 36 |
3 files changed, 43 insertions, 14 deletions
diff --git a/addons/web/static/src/js/action_manager.js b/addons/web/static/src/js/action_manager.js index 4110e45ba83..ec3441eee4c 100644 --- a/addons/web/static/src/js/action_manager.js +++ b/addons/web/static/src/js/action_manager.js @@ -336,7 +336,8 @@ var ActionManager = Widget.extend({ return action.title; } } - return _.pluck(this.get_breadcrumbs(), 'title').join(' / '); + var last_breadcrumb = _.last(this.get_breadcrumbs()); + return last_breadcrumb ? last_breadcrumb.title : ""; }, get_action_stack: function () { return this.action_stack; @@ -608,7 +609,7 @@ var ActionManager = Widget.extend({ var form = _.str.startsWith(action.view_mode, 'form'); action.flags = _.defaults(action.flags || {}, { views_switcher : !popup && !inline, - search_view : !popup && !inline, + search_view : !(popup && form) && !inline, action_buttons : !popup && !inline, sidebar : !popup && !inline, pager : (!popup || !form) && !inline, diff --git a/addons/web/static/src/js/view_manager.js b/addons/web/static/src/js/view_manager.js index f2c216ebd83..c5db4b954ca 100644 --- a/addons/web/static/src/js/view_manager.js +++ b/addons/web/static/src/js/view_manager.js @@ -141,12 +141,6 @@ var ViewManager = Widget.extend(ControlPanelMixin, { this.view_stack.pop(); } this.view_stack.push(view); - - // Hide active view (at first rendering, there is no view to hide) - if (this.active_view && this.active_view !== view) { - if (this.active_view.controller) this.active_view.controller.do_hide(); - if (this.active_view.$container) this.active_view.$container.hide(); - } this.active_view = view; if (!view.created) { @@ -188,10 +182,16 @@ var ViewManager = Widget.extend(ControlPanelMixin, { }; self.update_control_panel(cp_status); - // Detach the old view but not ui-autocomplete elements to let - // jquery-ui garbage-collect them if (old_view) { + // Detach the old view but not ui-autocomplete elements to let + // jquery-ui garbage-collect them old_view.$container.contents().not('.ui-autocomplete').detach(); + + // Hide old view (at first rendering, there is no view to hide) + if (self.active_view !== old_view) { + if (old_view.controller) old_view.controller.do_hide(); + if (old_view.$container) old_view.$container.hide(); + } } // Append the view fragment to its $container diff --git a/addons/web/static/src/js/widgets/user_menu.js b/addons/web/static/src/js/widgets/user_menu.js index f9c658525a4..60d1cc818d6 100644 --- a/addons/web/static/src/js/widgets/user_menu.js +++ b/addons/web/static/src/js/widgets/user_menu.js @@ -11,7 +11,7 @@ var Widget = require('web.Widget'); var _t = core._t; var QWeb = core.qweb; -var SystrayMenu = Widget.extend({ +var UserMenu = Widget.extend({ template: "UserMenu", init: function(parent) { this._super(parent); @@ -55,8 +55,33 @@ var SystrayMenu = Widget.extend({ }; this.update_promise = this.update_promise.then(fct, fct); }, - on_menu_logout: function() { - this.trigger('user_logout'); + on_menu_documentation: function () { + window.open('https://www.odoo.com/documentation/user', '_blank'); + }, + on_menu_support: function () { + window.open('https://www.odoo.com/buy', '_blank'); + }, + on_menu_about: function () { + var self = this; + if (odoo.db_info) { + menu_help_about(odoo.db_info); + } else { + this.rpc("/web/webclient/version_info", {}).done(menu_help_about); + } + + function menu_help_about(db_info) { + var $help = $(QWeb.render("UserMenu.about", {db_info: db_info})); + $help.find('a.oe_activate_debug_mode').click(function (e) { + e.preventDefault(); + window.location = $.param.querystring(window.location.href, 'debug'); + }); + new Dialog(self, { + size: 'medium', + dialogClass: 'o_act_window', + title: _t("About"), + $content: $help + }).open(); + } }, on_menu_settings: function() { var self = this; @@ -88,7 +113,10 @@ var SystrayMenu = Widget.extend({ }); }); }, + on_menu_logout: function() { + this.trigger('user_logout'); + }, }); -return SystrayMenu; +return UserMenu; }); |
