diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-08-20 12:17:04 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-08-20 12:17:04 +0200 |
| commit | f26de445e5579913e27ea6a630bcee6d40eefc7d (patch) | |
| tree | 8b8e06be8a9d5fd3c1e5c31634611127446b9948 /addons/website_event/static/src | |
| parent | bc6accc5688d3c38a35949751779f808e9c2063f (diff) | |
| parent | 6f55fd65da8c50d36ca97654a920fb075076f125 (diff) | |
[MERGE] forward port branch saas-12.3 up to 6f55fd65da8
Diffstat (limited to 'addons/website_event/static/src')
| -rw-r--r-- | addons/website_event/static/src/js/website_geolocation.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/addons/website_event/static/src/js/website_geolocation.js b/addons/website_event/static/src/js/website_geolocation.js index 19ee2f87033..5e81eb0adce 100644 --- a/addons/website_event/static/src/js/website_geolocation.js +++ b/addons/website_event/static/src/js/website_geolocation.js @@ -12,12 +12,22 @@ publicWidget.registry.visitor = publicWidget.Widget.extend({ start: function () { var defs = [this._super.apply(this, arguments)]; var self = this; + var $eventList = this.$('.country_events_list'); + this._originalContent = $eventList[0].outerHTML; defs.push(this._rpc({route: '/event/get_country_event_list'}).then(function (data) { if (data) { - self.$('.country_events_list').replaceWith(data); + self._$loadedContent = $(data); + $eventList.replaceWith(self._$loadedContent); } })); return Promise.all(defs); }, + /** + * @override + */ + destroy: function () { + this._super.apply(this, arguments); + this._$loadedContent.replaceWith(this._originalContent); + }, }); }); |
