[FIX] web: allow the usage of .at in lower versions of Safari
Commit [1] refactored the mail code and introduced a few .at called on Array typed objects. This is not supported in lower versions of iOS which some of our users and visitors still use as shown by [2]. This commit introduces a polyfill to support the feature on Safari <=15.3. [1]: https://github.com/odoo/odoo/commit/631ae1c4d865b912a59ddc8a068bdbf2dedd6a04 [2]: https://github.com/odoo/odoo/issues/142022 opw-3824593 closes odoo/odoo#160758 Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
@@ -124,6 +124,7 @@ This module provides the core of the Odoo Web Client.
|
||||
],
|
||||
'web.assets_frontend_minimal': [
|
||||
'web/static/src/polyfills/object.js',
|
||||
'web/static/src/polyfills/array.js',
|
||||
'web/static/src/module_loader.js',
|
||||
'web/static/src/session.js',
|
||||
'web/static/src/core/browser/cookie.js',
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
if (!Array.prototype.at) {
|
||||
Array.prototype.at = function (index) {
|
||||
if (index >= 0) {
|
||||
return this[index];
|
||||
}
|
||||
return this[this.length + index];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user