diff options
| author | Odoo's Mergebot <xmo+roboto@odoo.com> | 2020-04-28 18:50:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-28 18:50:55 +0200 |
| commit | f731cc3de3384dc0807aa37c5a1710701c23b3fa (patch) | |
| tree | 42a4a47eceee823c1b10787abb3d85230c636259 /addons/web/static/src/js | |
| parent | 8800869a1ca5c8a0cca7881691d7a0922db0d7ca (diff) | |
| parent | 6def725c6ef4faee72f7000e7e22f1b495ea0b52 (diff) | |
[IMP] web: update Owl to v1.0.7
Update to the version **1.0.7** of the Owl framework.
Some code conflicting with the new behaviour of `mount(target, { position: self })` has been slightly tweaked to work as expected.
closes odoo/odoo#50240
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/owl_compatibility.js | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/addons/web/static/src/js/owl_compatibility.js b/addons/web/static/src/js/owl_compatibility.js index 01deee7a4a3..45f387c3e41 100644 --- a/addons/web/static/src/js/owl_compatibility.js +++ b/addons/web/static/src/js/owl_compatibility.js @@ -445,11 +445,9 @@ odoo.define('web.OwlCompatibility', function () { // we may not be in the DOM, but actually want to be redrawn // (e.g. we were detached from the DOM, and now we're going to // be re-attached, but we need to be reloaded first). In this - // case, we have to fool Owl as it would skip the rendering if - // we simply call render. - const tmpEl = document.createElement('div'); - this.el.parentElement.replaceChild(tmpEl, this.el); - prom = this.mount(tmpEl, { position: 'self' }); + // case, we have to call 'mount' as Owl would skip the rendering + // if we simply call render. + prom = this.mount(...this._mountArgs); } return prom; } @@ -494,6 +492,22 @@ odoo.define('web.OwlCompatibility', function () { } parentChildren.push(this); } + /** + * Stores mount target and position at first mount. That way, when updating + * while out of DOM, we know where and how to remount. + * @see update() + * @override + */ + async mount(target, options) { + if (options && options.position === 'self') { + throw new Error( + 'Unsupported position: "self" is not allowed for wrapper components. ' + + 'Contact the JS Framework team or open an issue if your use case is relevant.' + ); + } + this._mountArgs = arguments; + return super.mount(...arguments); + } } ComponentWrapper.template = xml`<t t-component="Component" t-props="props" t-ref="component"/>`; |
