summaryrefslogtreecommitdiff
path: root/addons/website_event/static/src/js/website_geolocation.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/website_event/static/src/js/website_geolocation.js')
-rw-r--r--addons/website_event/static/src/js/website_geolocation.js12
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);
+ },
});
});