diff --git a/addons/website/static/src/js/website.ace.js b/addons/website/static/src/js/website.ace.js index c67421be004..f3b8a5c5885 100644 --- a/addons/website/static/src/js/website.ace.js +++ b/addons/website/static/src/js/website.ace.js @@ -136,9 +136,11 @@ $('button[data-action=edit]').click(function () { self.close(); }); - this.getParent().on('resize', this, resizeEditorHeight); + this.getParent().on('change:height', this, function (editor) { + resizeEditorHeight(editor.get('height')); + }); resizeEditor(readEditorWidth()); - resizeEditorHeight(this.getParent().height); + resizeEditorHeight(this.getParent().get('height')); }, loadViews: function (views) { var self = this; diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 661c6d80a5f..51f14a0f6d5 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -422,7 +422,6 @@ }, start: function() { var self = this; - this.height = null; this.saving_mutex = new openerp.Mutex(); this.$('#website-top-edit').hide(); @@ -457,10 +456,9 @@ }, check_height: function () { var editor_height = this.$el.outerHeight(); - if (this.height != editor_height) { - this.height = editor_height; - $(document.body).css('padding-top', this.height); - this.trigger('resize', this.height); + if (this.get('height') != editor_height) { + $(document.body).css('padding-top', editor_height); + this.set('height', editor_height); } }, edit: function () { diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 44300b59643..d4f8920663a 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -140,8 +140,8 @@ e.preventDefault(); }); - this.getParent().on('resize', this, function (height) { - self.$el.css('top', height); + this.getParent().on('change:height', this, function (editor) { + self.$el.css('top', editor.get('height')); }); }, fetch_snippet_templates: function () {