summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/widgets/debug_manager.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-03-03 15:30:53 +0100
committerAaron Bohy <aab@odoo.com>2015-03-20 16:34:41 +0100
commit20b4aaab83ea6f35347773754d644806a2f65b5d (patch)
tree8ed311a9d7dc771cf21d1d8f8f2265ad57fd34b2 /addons/web/static/src/js/widgets/debug_manager.js
parent913942a32756d6356b33b40efdeae361924e7de6 (diff)
[REF] Web: Actions, ActionManager, ViewManager, Controlpanel refactoring
Big refactoring of Action, WidgetAction and ViewManagerAction to clean their API. Mainly, renamming from State to Action and removal of unused functions (or functions that are only used by the DebugManager, for which we tolerate introspection). Some logic has also been moved from the ActionManager to the Actions themselves. The specific behavior of each type of Action is now handled in the implementation of those Actions. In ActionManager, this.states is renammed to this.action_stack to be consistent with view_stack in ViewManager. The setup_search_view() and render_switch_buttons() functions have been moved from ControlPanel to ViewManager as it was before, since actual design allows it and it makes more sense. The ControlPanel API has also been simplified as some functions were not used anymore. The ControlPanel is now updated directly by the widgets using it, bypassing the ActionManager. The control panel elements are stored by the widgets themselves to allow restoring them later.
Diffstat (limited to 'addons/web/static/src/js/widgets/debug_manager.js')
-rw-r--r--addons/web/static/src/js/widgets/debug_manager.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/web/static/src/js/widgets/debug_manager.js b/addons/web/static/src/js/widgets/debug_manager.js
index 4fffdab9294..0bd7a772425 100644
--- a/addons/web/static/src/js/widgets/debug_manager.js
+++ b/addons/web/static/src/js/widgets/debug_manager.js
@@ -26,9 +26,9 @@ if (core.debug) {
this.$dropdown = this.$(".js_debug_dropdown");
},
/**
- * Updates its attributes according to the current state of the ActionManager
+ * Updates its attributes according to the inner_widget of the ActionManager
*/
- _update_state: function() {
+ _update: function() {
this.view_manager = odoo.__DEBUG__.services['web.web_client'].action_manager.get_inner_widget();
if (!this.view_manager instanceof ViewManager) { return; }
this.dataset = this.view_manager.dataset;
@@ -38,7 +38,7 @@ if (core.debug) {
return true;
},
/**
- * Renders dropdown according to the current state
+ * Renders the DebugManager dropdown
*/
render_dropdown: function() {
var self = this;
@@ -46,8 +46,8 @@ if (core.debug) {
// Empty the previously rendered dropdown
this.$dropdown.empty();
- // Attempt to retrieve the current state of the ActionManager
- if (!this._update_state()) {
+ // Attempt to retrieve the inner_widget of the ActionManager
+ if (!this._update()) {
// Disable the button when not available
console.warn("DebugManager is not available");
return;