summaryrefslogtreecommitdiff
path: root/addons/web_dashboard/static/src/js
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2011-11-23 23:50:44 +0100
committerFabien Meghazi <fme@openerp.com>2011-11-23 23:50:44 +0100
commitce31ddc49f83bcaaaddbdc5c99ded4c2c3caf696 (patch)
tree0842e207853b6a4d939e31dd314c234c2a408f38 /addons/web_dashboard/static/src/js
parent57da819cf25a848b1da358e870bd9fccb6d1f4b1 (diff)
[REM] Removed Add Widget from dashboard
bzr revid: fme@openerp.com-20111123225044-30nu2tchsvfatqtc
Diffstat (limited to 'addons/web_dashboard/static/src/js')
-rw-r--r--addons/web_dashboard/static/src/js/dashboard.js12
1 files changed, 7 insertions, 5 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);