diff options
| author | Aaron Bohy <aab@odoo.com> | 2018-10-22 11:03:17 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2018-10-23 10:56:12 +0000 |
| commit | 03fe95d6af9d96f961c47d9acfaec498966b8cfa (patch) | |
| tree | 4ae97e4007ef1642b21cdaae596201a17e3cb316 /addons/web/static/src/js/views/graph | |
| parent | 3c59add416fdba779675dc79580f6c0f56abc5a3 (diff) | |
[REF] web: small refactoring pass on some web components
(mainly views and ActionManager)
- add missing docstrings
- fix typos
- correctly order functions and imports
- put functions in correct sections
- stop using 'event' as argument of handlers
- don't call handlers directly
- remove trailing spaces/tabs
- move module created in stable version to its own file
- follow js guidelines in general
closes odoo/odoo#28024
Diffstat (limited to 'addons/web/static/src/js/views/graph')
| -rw-r--r-- | addons/web/static/src/js/views/graph/graph_controller.js | 10 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/graph/graph_renderer.js | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/addons/web/static/src/js/views/graph/graph_controller.js b/addons/web/static/src/js/views/graph/graph_controller.js index 48f15de8902..09992695506 100644 --- a/addons/web/static/src/js/views/graph/graph_controller.js +++ b/addons/web/static/src/js/views/graph/graph_controller.js @@ -175,17 +175,17 @@ var GraphController = AbstractController.extend(GroupByMenuInterfaceMixin,{ * Do what need to be done when a button from the control panel is clicked. * * @private - * @param {MouseEvent} event + * @param {MouseEvent} ev */ - _onButtonClick: function (event) { - var $target = $(event.target); + _onButtonClick: function (ev) { + var $target = $(ev.target); var parent; var field; if ($target.hasClass('o_graph_button')) { this._setMode($target.data('mode')); } else if ($target.parents('.o_graph_measures_list').length) { - event.preventDefault(); - event.stopPropagation(); + ev.preventDefault(); + ev.stopPropagation(); field = $target.data('field'); this._setMeasure(field); } diff --git a/addons/web/static/src/js/views/graph/graph_renderer.js b/addons/web/static/src/js/views/graph/graph_renderer.js index 0517e14c876..e68a4446ba5 100644 --- a/addons/web/static/src/js/views/graph/graph_renderer.js +++ b/addons/web/static/src/js/views/graph/graph_renderer.js @@ -68,6 +68,11 @@ return AbstractRenderer.extend({ this._super.apply(this, arguments); this.isInDOM = false; }, + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + /** * @override * @param {Object} state |
