diff --git a/addons/web_unsplash/static/src/js/unsplash_beacon.js b/addons/web_unsplash/static/src/js/unsplash_beacon.js index 53600aacb48..79de88ea9d1 100644 --- a/addons/web_unsplash/static/src/js/unsplash_beacon.js +++ b/addons/web_unsplash/static/src/js/unsplash_beacon.js @@ -10,7 +10,7 @@ publicWidget.registry.UnsplashBeacon = publicWidget.Widget.extend({ * @override */ start: function () { - var unsplashImages = this.$('img[src*="/unsplash/"]').map((img) => { + var unsplashImages = Array.from(this.$('img[src*="/unsplash/"]')).map((img) => { // get image id from URL (`http://www.domain.com:1234/unsplash/xYdf5feoI/lion.jpg` -> `xYdf5feoI`) return img.src.split('/unsplash/')[1].split('/')[0]; }); diff --git a/addons/website/static/src/js/utils.js b/addons/website/static/src/js/utils.js index 778c38d83c3..6b4dfd84f62 100644 --- a/addons/website/static/src/js/utils.js +++ b/addons/website/static/src/js/utils.js @@ -123,7 +123,7 @@ function autocompleteWithPages(self, $input, options) { * @param {jQuery} [$excluded] */ function onceAllImagesLoaded($element, $excluded) { - var defs = $element.find('img').addBack('img').map(img => { + var defs = Array.from($element.find("img").addBack("img")).map((img) => { if (img.complete || $excluded && ($excluded.is(img) || $excluded.has(img).length)) { return; // Already loaded } diff --git a/addons/website/static/src/snippets/s_image_gallery/options.js b/addons/website/static/src/snippets/s_image_gallery/options.js index 71243d3a0ea..db5cd4bca50 100644 --- a/addons/website/static/src/snippets/s_image_gallery/options.js +++ b/addons/website/static/src/snippets/s_image_gallery/options.js @@ -278,7 +278,7 @@ options.registry.gallery = options.Class.extend({ */ slideshow: function () { const imageEls = this._getImages(); - const images = imageEls.map((img) => ({ + const images = Array.from(imageEls).map((img) => ({ // Use getAttribute to get the attribute value otherwise .src // returns the absolute url. src: img.getAttribute('src'), diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 25922139e89..afbe847d123 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -614,7 +614,7 @@ publicWidget.registry.websiteForumSpam = publicWidget.Widget.extend({ _onMarkSpamClick: function (ev) { var key = this.$('.modal .tab-pane.active').data('key'); var $inputs = this.$('.modal .tab-pane.active input.form-check-input:checked'); - var values = $inputs.map((o) => parseInt(o.value)); + var values = Array.from($inputs).map((o) => parseInt(o.value)); return this._rpc({model: 'forum.post', method: 'mark_as_offensive_batch', args: [this.spamIDs, key, values],