summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.snippets.editor.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/website/static/src/js/website.snippets.editor.js')
-rw-r--r--addons/website/static/src/js/website.snippets.editor.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js
index cfd0b561778..4fbb79dd89e 100644
--- a/addons/website/static/src/js/website.snippets.editor.js
+++ b/addons/website/static/src/js/website.snippets.editor.js
@@ -311,8 +311,10 @@ options.registry.parallax = options.Class.extend({
this.$target.data("snippet-view", new animation.registry.parallax(this.$target));
}
this.scroll();
- this.buildingBlock.$el.on("snippet-dropped snippet-activated", this._refresh.bind(this));
- this.$target.on('snippet-option-change snippet-option-preview', this._refresh.bind(this));
+
+ this._refresh_callback = this._refresh.bind(this);
+ this.buildingBlock.$el.on("snippet-dropped snippet-activated", this._refresh_callback);
+ this.$target.on('snippet-option-change snippet-option-preview', this._refresh_callback);
},
scroll: function (type, value) {
this.$target.attr("data-scroll-background-ratio", value);
@@ -330,6 +332,11 @@ options.registry.parallax = options.Class.extend({
this._super.apply(this, arguments);
this._refresh();
},
+ on_remove: function () {
+ this._super.apply(this, arguments);
+ this.$target.off("snippet-option-change snippet-option-preview", this._refresh_callback);
+ this.buildingBlock.$el.off("snippet-dropped snippet-activated", this._refresh_callback);
+ },
});
options.registry.ul = options.Class.extend({