summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/chrome/action_mixin.js8
-rw-r--r--addons/web/static/src/js/core/custom_hooks.js10
-rw-r--r--addons/web/static/src/js/main.js1
3 files changed, 10 insertions, 9 deletions
diff --git a/addons/web/static/src/js/chrome/action_mixin.js b/addons/web/static/src/js/chrome/action_mixin.js
index 1ca87c15ef3..a704e5736a0 100644
--- a/addons/web/static/src/js/chrome/action_mixin.js
+++ b/addons/web/static/src/js/chrome/action_mixin.js
@@ -20,9 +20,9 @@ odoo.define('web.ActionMixin', function (require) {
* @module web.ActionMixin
*/
- var core = require('web.core');
+ const core = require('web.core');
- var ActionMixin = {
+ const ActionMixin = {
template: 'Action',
/**
@@ -79,7 +79,7 @@ odoo.define('web.ActionMixin', function (require) {
renderElement: function () {
this._super.apply(this, arguments);
if (this.contentTemplate) {
- var content = core.qweb.render(this.contentTemplate, { widget: this });
+ const content = core.qweb.render(this.contentTemplate, { widget: this });
this.$('.o_content').append(content);
}
},
@@ -223,7 +223,7 @@ odoo.define('web.ActionMixin', function (require) {
*/
_onGetControllerQueryParams: function (ev) {
ev.stopPropagation();
- var state = this.getOwnedQueryParams();
+ const state = this.getOwnedQueryParams();
ev.data.callback(state || {});
},
};
diff --git a/addons/web/static/src/js/core/custom_hooks.js b/addons/web/static/src/js/core/custom_hooks.js
index c196dd7f900..69750066a8c 100644
--- a/addons/web/static/src/js/core/custom_hooks.js
+++ b/addons/web/static/src/js/core/custom_hooks.js
@@ -14,18 +14,18 @@ odoo.define('web.custom_hooks', function () {
*/
function useFocusOnUpdate() {
const component = Component.current;
- component.__willFocus = null;
+ let willFocus = null;
function _focusSelector() {
- if (component.__willFocus) {
- const target = component.el.querySelector(component.__willFocus);
+ if (willFocus) {
+ const target = component.el.querySelector(willFocus);
if (target) {
target.focus();
if (['INPUT', 'TEXTAREA'].includes(target.tagName)) {
target.selectionStart = target.selectionEnd = target.value.length;
}
}
- component.__willFocus = null;
+ willFocus = null;
}
}
@@ -33,7 +33,7 @@ odoo.define('web.custom_hooks', function () {
onPatched(_focusSelector);
return function focusOnUpdate(selector = '[autofocus]') {
- component.__willFocus = selector;
+ willFocus = selector;
};
}
diff --git a/addons/web/static/src/js/main.js b/addons/web/static/src/js/main.js
index 35f00254ba8..49b90228ba2 100644
--- a/addons/web/static/src/js/main.js
+++ b/addons/web/static/src/js/main.js
@@ -1,4 +1,5 @@
odoo.define('web.web_client', function (require) {
+ "use strict";
const env = require('web.env');
const session = require("web.session");