summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/widgets
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-08-24 09:31:52 +0200
committerAaron Bohy <aab@odoo.com>2015-09-01 20:05:09 +0200
commit0fe349def22d5832046ab89c7c629c73dc66d1c0 (patch)
treea32084b5c74570281402cd649fa5a60ac9ede6df /addons/web/static/src/js/widgets
parent5bd8e02dc854d6cb367817697c5446132f957302 (diff)
[IMP] web: sidebar: generalize it for client actions
Diffstat (limited to 'addons/web/static/src/js/widgets')
-rw-r--r--addons/web/static/src/js/widgets/sidebar.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/addons/web/static/src/js/widgets/sidebar.js b/addons/web/static/src/js/widgets/sidebar.js
index 18f488cdfec..90ec1024d7c 100644
--- a/addons/web/static/src/js/widgets/sidebar.js
+++ b/addons/web/static/src/js/widgets/sidebar.js
@@ -13,17 +13,19 @@ var QWeb = core.qweb;
var _t = core._t;
var Sidebar = Widget.extend({
- init: function(parent) {
+ init: function(parent, options) {
var self = this;
this._super(parent);
- this.view = this.getParent();
- this.sections = [
- { 'name' : 'print', 'label' : _t('Print'), },
- { 'name' : 'other', 'label' : _t('More'), }
+ this.options = _.defaults(options || {}, {
+ 'editable': true
+ });
+ this.sections = options.sections || [
+ {name: 'print', label: _t('Print')},
+ {name: 'other', label: _t('More')},
];
- this.items = {
- 'print' : [],
- 'other' : []
+ this.items = options.items || {
+ print: [],
+ other: [],
};
this.fileupload_id = _.uniqueId('oe_fileupload');
$(window).on(this.fileupload_id, function() {