[REM] Removed Add Widget from dashboard

bzr revid: fme@openerp.com-20111123225044-30nu2tchsvfatqtc
This commit is contained in:
Fabien Meghazi 2011-11-23 23:50:44 +01:00
parent 57da819cf2
commit ce31ddc49f
2 changed files with 8 additions and 6 deletions

View File

@ -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);

View File

@ -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">