Fix mail compose resize does not work always

This commit is contained in:
Hadi Nategh 2015-09-23 11:37:44 +00:00
parent f8f586eeab
commit d008e8d378

View File

@ -205,6 +205,7 @@ app.classes.mail = AppJS.extend(
// use a wrapper on a different url to be able to use a different fpm pool
et2.menuaction = 'mail_compose::ajax_send';
var that = this;
var textAreaWidget = this.et2.getWidgetById('mail_htmltext');
this.mail_isMainWindow = false;
this.compose_fieldExpander_init();
this.check_sharing_filemode();
@ -225,9 +226,14 @@ app.classes.mail = AppJS.extend(
});
/*Trigger compose_resizeHandler after the CKEditor is fully loaded*/
jQuery('#mail-compose').on ('load',function() {
window.setTimeout(function(){
that.compose_fieldExpander();
}, 300);
if (textAreaWidget && typeof textAreaWidget.ckeditor != 'undefined')
{
textAreaWidget.ckeditor.on('instanceReady', function(){that.compose_fieldExpander();});
}
else
{
this.compose_fieldExpander();
}
});
//Resize compose after window resize to not getting scrollbar
@ -254,7 +260,7 @@ app.classes.mail = AppJS.extend(
}
else
{
this.et2.getWidgetById('mail_htmltext').ckeditor.on('instanceReady', function(e) {
textAreaWidget.ckeditor.on('instanceReady', function(e) {
this.focus();
});
}