[IMP] Better events naming for EditorBar height related stuff

bzr revid: fme@openerp.com-20131218201619-vja6dv0sctokep3b
This commit is contained in:
Fabien Meghazi
2013-12-18 21:16:19 +01:00
parent 9abcc28884
commit b180d69808
3 changed files with 9 additions and 9 deletions
+4 -2
View File
@@ -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;
@@ -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 () {
@@ -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 () {