diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-06-08 12:28:16 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-06-08 12:28:16 +0200 |
| commit | 7306e888a65cab60bf8348eb5672fc254ba7dd79 (patch) | |
| tree | b93e07546e3e390bd86dc15a7f9171b01b28781b /addons/web/static/src/js | |
| parent | a199988c996065acaf7a8d1dd0f8d6e6141ba92f (diff) | |
| parent | ac5023060c1cd356ceb39dd1b17de7df7f2eaf43 (diff) | |
[MERGE] forward port of branch saas-11 up to ac50230
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/control_panel.js | 5 | ||||
| -rw-r--r-- | addons/web/static/src/js/framework/data_manager.js | 4 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/graph_widget.js | 4 | ||||
| -rw-r--r-- | addons/web/static/src/js/widgets/sidebar.js | 13 |
4 files changed, 16 insertions, 10 deletions
diff --git a/addons/web/static/src/js/control_panel.js b/addons/web/static/src/js/control_panel.js index 24e94b94fbb..80744f243e9 100644 --- a/addons/web/static/src/js/control_panel.js +++ b/addons/web/static/src/js/control_panel.js @@ -66,6 +66,11 @@ var ControlPanel = Widget.extend({ $switch_buttons: this.$('.o_cp_switch_buttons'), }; + // Prevent the search dropdowns to close when clicking inside them + this.$el.on('click.bs.dropdown', '.oe-search-options .dropdown-menu', function (e) { + e.stopPropagation(); + }); + // By default, hide the ControlPanel and remove its contents from the DOM this._toggle_visibility(false); diff --git a/addons/web/static/src/js/framework/data_manager.js b/addons/web/static/src/js/framework/data_manager.js index 73521e1a06d..29d6d585f6a 100644 --- a/addons/web/static/src/js/framework/data_manager.js +++ b/addons/web/static/src/js/framework/data_manager.js @@ -39,7 +39,9 @@ return core.Class.extend({ }, this._invalidate.bind(this, this._cache.actions, key)); } - return this._cache.actions[key]; + return this._cache.actions[key].then(function (action) { + return $.extend(true, {}, action); + }); }, /** diff --git a/addons/web/static/src/js/views/graph_widget.js b/addons/web/static/src/js/views/graph_widget.js index ed528768329..017801c2297 100644 --- a/addons/web/static/src/js/views/graph_widget.js +++ b/addons/web/static/src/js/views/graph_widget.js @@ -165,7 +165,7 @@ return Widget.extend({ var chart = nv.models.multiBarChart(); var maxVal = _.max(values, function(v) {return v.y}) chart.options({ - margin: {left: 12 * String(maxVal && maxVal.y || 0).length}, + margin: {left: 12 * String(maxVal && maxVal.y || 10000000).length}, delay: 250, transition: 10, showLegend: _.size(data) <= MAX_LEGEND_LENGTH, @@ -297,7 +297,7 @@ return Widget.extend({ var chart = nv.models.lineChart(); var maxVal = _.max(values, function(v) {return v.y}) chart.options({ - margin: {left: 12 * String(maxVal && maxVal.y || 0).length, right: 50}, + margin: {left: 12 * String(maxVal && maxVal.y || 10000000).length, right: 50}, useInteractiveGuideline: true, showLegend: _.size(data) <= MAX_LEGEND_LENGTH, showXAxis: true, diff --git a/addons/web/static/src/js/widgets/sidebar.js b/addons/web/static/src/js/widgets/sidebar.js index e2222526320..03997db6c36 100644 --- a/addons/web/static/src/js/widgets/sidebar.js +++ b/addons/web/static/src/js/widgets/sidebar.js @@ -103,13 +103,13 @@ var Sidebar = Widget.extend({ _.each(['print','action','relate'], function(type) { var items = toolbar[type]; if (items) { - for (var i = 0; i < items.length; i++) { - items[i] = { - label: items[i]['name'], - action: items[i], + var actions = _.map(items, function (item) { + return { + label: item.name, + action: item, }; - } - self.add_items(type=='print' ? 'print' : 'other', items); + }); + self.add_items(type === 'print' ? 'print' : 'other', actions); } }); }, @@ -218,4 +218,3 @@ var Sidebar = Widget.extend({ return Sidebar; }); - |
