diff options
| author | Fabien Meghazi <fme@openerp.com> | 2011-11-23 23:50:44 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2011-11-23 23:50:44 +0100 |
| commit | ce31ddc49f83bcaaaddbdc5c99ded4c2c3caf696 (patch) | |
| tree | 0842e207853b6a4d939e31dd314c234c2a408f38 /addons/web_dashboard/static | |
| parent | 57da819cf25a848b1da358e870bd9fccb6d1f4b1 (diff) | |
[REM] Removed Add Widget from dashboard
bzr revid: fme@openerp.com-20111123225044-30nu2tchsvfatqtc
Diffstat (limited to 'addons/web_dashboard/static')
| -rw-r--r-- | addons/web_dashboard/static/src/js/dashboard.js | 12 | ||||
| -rw-r--r-- | addons/web_dashboard/static/src/xml/web_dashboard.xml | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 9e07703f3fa..82fb7e3abe9 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -33,15 +33,17 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ this.actions_attrs = {}; // Init actions - _.each(this.node.children, function(column) { - _.each(column.children, function(action) { + _.each(this.node.children, function(column, column_index) { + _.each(column.children, function(action, action_index) { delete(action.attrs.width); delete(action.attrs.height); delete(action.attrs.colspan); self.actions_attrs[action.attrs.name] = action.attrs; self.rpc('/web/action/load', { action_id: parseInt(action.attrs.name, 10) - }, self.on_load_action); + }, function(result) { + self.on_load_action(result, column_index + '_' + action_index); + }); }); }); }, @@ -135,7 +137,7 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ self.$element.find('.oe-dashboard-link-undo, .oe-dashboard-link-reset').show(); }); }, - on_load_action: function(result) { + on_load_action: function(result, index) { var self = this, action = result.result, action_attrs = this.actions_attrs[action.id], @@ -179,7 +181,7 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ }; var am = new openerp.web.ActionManager(this); this.action_managers.push(am); - am.appendTo($("#"+this.view.element_id + '_action_' + action.id)); + am.appendTo($('#' + this.view.element_id + '_action_' + index)); am.do_action(action); am.do_action = function(action) { self.do_action(action); diff --git a/addons/web_dashboard/static/src/xml/web_dashboard.xml b/addons/web_dashboard/static/src/xml/web_dashboard.xml index 589e2f39245..9703013f777 100644 --- a/addons/web_dashboard/static/src/xml/web_dashboard.xml +++ b/addons/web_dashboard/static/src/xml/web_dashboard.xml @@ -33,7 +33,7 @@ <span class='ui-icon ui-icon-minusthick oe-dashboard-fold' t-if="!action.attrs.fold"></span> <span class='ui-icon ui-icon-plusthick oe-dashboard-fold' t-if="action.attrs.fold"></span> </h2> - <div t-att-id="view.element_id + '_action_' + action.attrs.name" class="oe-dashboard-action-content" t-att-style="action.attrs.fold ? 'display: none' : null"></div> + <div t-attf-id="#{view.element_id}_action_#{column_index}_#{action_index}" class="oe-dashboard-action-content" t-att-style="action.attrs.fold ? 'display: none' : null"></div> </div> </t> <t t-name="DashBoard.layouts"> |
