Merge lp:~openerp-dev/openerp-web/7.0-opw-591027-msh into lp:openerp-web/7.0

Proposed by Mohammed Shekha(Open ERP)
Status: Merged
Merged at revision: 3953
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-591027-msh
Merge into: lp:openerp-web/7.0
Diff against target: 16 lines (+6/-0)
1 file modified
addons/web/static/lib/cleditor/jquery.cleditor.js (+6/-0)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-591027-msh
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+157870@code.launchpad.net

Description of the change

Hello,

Fixed the issue of cleditor, on window resize blur event not triggered except firefox so due to which value disappears from the container.

Demo:- (Any other browser than firefox) Open any view where there is TextHtml widget available, better to have in dialog to test this, open from "Compose a new message" and write some text in TextHtml widget and without lossing focus from widget resize dialog, firefox triggers blur and hence change but in other browser blur is not triggered and hence not change triggered so textarea doesn't get updated and text disappers as resize window calls refresh editor.

Thanks.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/lib/cleditor/jquery.cleditor.js'
2--- addons/web/static/lib/cleditor/jquery.cleditor.js 2013-01-09 16:46:26 +0000
3+++ addons/web/static/lib/cleditor/jquery.cleditor.js 2013-04-09 13:04:31 +0000
4@@ -296,6 +296,12 @@
5 // Bind the window resize event when the width or height is auto or %
6 if (/auto|%/.test("" + options.width + options.height))
7 $(window).resize(function() {
8+ //Forcefully blurred iframe contentWindow, chrome, IE, safari doesn't trigger blur on window resize and due to which text disappears
9+ var $frame = editor.$frame[0];
10+ if(!$.browser.mozilla && $frame.contentWindow){
11+ var contentWindow = $frame.contentWindow;
12+ $(contentWindow).trigger('blur');
13+ }
14 // CHM Note MonkeyPatch: if the DOM is not remove, refresh the cleditor
15 if(editor.$main.parent().parent().size()) {
16 refresh(editor);