summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.snippets.editor.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-10-19 18:16:14 +0200
committerChristophe Simonis <chs@odoo.com>2016-10-19 18:16:14 +0200
commit938ffb92da1ea898f661aec04745f7630e2f378c (patch)
tree7faeed8433101836cd0239cf6c23629ef1f1289d /addons/website/static/src/js/website.snippets.editor.js
parent1f9e92dfef325b6727e1bee3de55bff095ec6cf2 (diff)
parent6466aa499fc37bba5f4feeeecac99448ef88e62e (diff)
[MERGE] forward port branch 10.0 up to 6466aa4
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({