summaryrefslogtreecommitdiff
path: root/addons/base_dashboard/static/src/js
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2011-06-07 11:08:22 +0200
committerFabien Meghazi <fme@openerp.com>2011-06-07 11:08:22 +0200
commit49d4e85e5e4e7af3225d3f571d3f14ff7113371f (patch)
tree98b809bac30c75004bb745044566c8d5e239609e /addons/base_dashboard/static/src/js
parent01dcbe531334a7dc1ef60d6e37ccd423f6c827a8 (diff)
[ADD] Fold/Unfold action are saved in the dashboard views
bzr revid: fme@openerp.com-20110607090822-a675ez2c6x7jsphk
Diffstat (limited to 'addons/base_dashboard/static/src/js')
-rw-r--r--addons/base_dashboard/static/src/js/dashboard.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/addons/base_dashboard/static/src/js/dashboard.js b/addons/base_dashboard/static/src/js/dashboard.js
index 52632444c67..b6831fe28e9 100644
--- a/addons/base_dashboard/static/src/js/dashboard.js
+++ b/addons/base_dashboard/static/src/js/dashboard.js
@@ -22,7 +22,7 @@ openerp.base.form.DashBoard = openerp.base.form.Widget.extend({
this.$element.find('.oe-dashboard-link-reset').click(this.on_reset);
this.$element.find('.oe-dashboard-link-add_widget').click(this.on_add_widget);
this.$element.find('.oe-dashboard-link-change_layout').click(this.on_change_layout);
- this.$element.find('.oe-dashboard-column .ui-icon-minusthick').click(this.on_fold_action);
+ this.$element.find('.oe-dashboard-column .oe-dashboard-fold').click(this.on_fold_action);
this.$element.find('.oe-dashboard-column .ui-icon-closethick').click(this.on_close_action);
this.actions_attrs = {};
@@ -97,7 +97,6 @@ openerp.base.form.DashBoard = openerp.base.form.Widget.extend({
actions = action_manager.viewmanager.views.list.controller.groups.get_selection().ids,
results = [],
qdict = { view : this.view };
- console.log(this.actions_attrs)
// TODO: should load multiple actions at once
_.each(actions, function(aid) {
self.rpc('/base/action/load', {
@@ -180,9 +179,17 @@ openerp.base.form.DashBoard = openerp.base.form.Widget.extend({
}
},
on_fold_action: function(e) {
- var $e = $(e.currentTarget);
+ var $e = $(e.currentTarget),
+ $action = $e.parents('.oe-dashboard-action:first'),
+ id = parseInt($action.attr('data-id'), 10);
+ if ($e.is('.ui-icon-minusthick')) {
+ this.actions_attrs[id].fold = '1';
+ } else {
+ delete(this.actions_attrs[id].fold);
+ }
$e.toggleClass('ui-icon-minusthick ui-icon-plusthick');
- $e.parents('.oe-dashboard-action:first').find('.oe-dashboard-action-content').toggle();
+ $action.find('.oe-dashboard-action-content').toggle();
+ this.do_save_dashboard();
},
on_close_action: function(e) {
$(e.currentTarget).parents('.oe-dashboard-action:first').remove();