summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_renderer.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2018-10-22 11:03:17 +0000
committerAaron Bohy <aab@odoo.com>2018-10-23 10:56:12 +0000
commit03fe95d6af9d96f961c47d9acfaec498966b8cfa (patch)
tree4ae97e4007ef1642b21cdaae596201a17e3cb316 /addons/web/static/src/js/views/basic/basic_renderer.js
parent3c59add416fdba779675dc79580f6c0f56abc5a3 (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/basic/basic_renderer.js')
-rw-r--r--addons/web/static/src/js/views/basic/basic_renderer.js42
1 files changed, 21 insertions, 21 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_renderer.js b/addons/web/static/src/js/views/basic/basic_renderer.js
index 33267283a15..8db200183ef 100644
--- a/addons/web/static/src/js/views/basic/basic_renderer.js
+++ b/addons/web/static/src/js/views/basic/basic_renderer.js
@@ -136,31 +136,12 @@ var BasicRenderer = AbstractRenderer.extend({
dom.setSelectionRange(field.getFocusableElement().get(0), {start: offset, end: offset});
}
},
+
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
/**
- * Add a tooltip on a $node, depending on a field description
- *
- * @param {FieldWidget} widget
- * @param {$node} $node
- */
- _addFieldTooltip: function (widget, $node) {
- // optional argument $node, the jQuery element on which the tooltip
- // should be attached if not given, the tooltip is attached on the
- // widget's $el
- $node = $node.length ? $node : widget.$el;
- $node.tooltip({
- title: function () {
- return qweb.render('WidgetLabel.tooltip', {
- debug: config.debug,
- widget: widget,
- });
- }
- });
- },
- /**
* Activates the widget at the given index for the given record if possible
* or the "next" possible one. Usually, a widget can be activated if it is
* in edit mode, and if it is visible.
@@ -239,6 +220,26 @@ var BasicRenderer = AbstractRenderer.extend({
return this._activateFieldWidget(record, currentIndex, {inc:-1});
},
/**
+ * Add a tooltip on a $node, depending on a field description
+ *
+ * @param {FieldWidget} widget
+ * @param {$node} $node
+ */
+ _addFieldTooltip: function (widget, $node) {
+ // optional argument $node, the jQuery element on which the tooltip
+ // should be attached if not given, the tooltip is attached on the
+ // widget's $el
+ $node = $node.length ? $node : widget.$el;
+ $node.tooltip({
+ title: function () {
+ return qweb.render('WidgetLabel.tooltip', {
+ debug: config.debug,
+ widget: widget,
+ });
+ }
+ });
+ },
+ /**
* Does the necessary DOM updates to match the given modifiers data. The
* modifiers data is supposed to contain the properly evaluated modifiers
* associated to the given records and elements.
@@ -685,7 +686,6 @@ var BasicRenderer = AbstractRenderer.extend({
return $el;
},
-
/**
* Rerenders a given widget and make sure the associated data which
* referenced the old one is updated.