[MERGE] cleditor: on window resize blur event not triggered except firefox so due to which value disappears from the container.

bzr revid: chm@openerp.com-20130606144437-c9rccpsqjv13t3rw
This commit is contained in:
Christophe Matthieu 2013-06-06 16:44:37 +02:00
commit 22f268328c
1 changed files with 5 additions and 0 deletions

View File

@ -296,6 +296,11 @@
// Bind the window resize event when the width or height is auto or %
if (/auto|%/.test("" + options.width + options.height))
$(window).resize(function() {
//Forcefully blurred iframe contentWindow, chrome, IE, safari doesn't trigger blur on window resize and due to which text disappears
var contentWindow = editor.$frame[0].contentWindow;
if(!$.browser.mozilla && contentWindow){
$(contentWindow).trigger('blur');
}
// CHM Note MonkeyPatch: if the DOM is not remove, refresh the cleditor
if(editor.$main.parent().parent().size()) {
refresh(editor);