Code edited in the cleditor library, prevents other usages

Bug #1258463 reported by Guewen Baconnier @ Camptocamp
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

Hello,

The "cleditor" vendor'ed library has been modified locally [0].
The change:

    $(window).resize(function() {
        // <snip>

        // CHM Note MonkeyPatch: if the DOM is not remove, refresh the cleditor
        if(editor.$main.parent().parent().size()) {
          refresh(editor);
        }
    });

So when the window is resized, the editors get resized. This works with the actual widget, but prevents it to works when we want to use cleditor in another way (example: dialog for translations [1]).

The problem is that at a point, editor is still there in the bound function and has been destroyed when the refresh function is called, so we get: Uncaught TypeError: Cannot read property 'document' of null (at line 822 [2])

[0] http://bazaar.launchpad.net/~openerp/openerp-web/7.0/view/head:/addons/web/static/lib/cleditor/jquery.cleditor.js#L304
[1] http://bazaar.launchpad.net/~camptocamp/web-addons/7.0-web_translate_dialog_page/view/head:/web_translate_dialog_page/static/src/js/web_translate_dialog_page.js
[2] http://bazaar.launchpad.net/~openerp/openerp-web/7.0/view/head:/addons/web/static/lib/cleditor/jquery.cleditor.js#L822

summary: - Edition of the cleditor library prevent other usages
+ Code edited in the cleditor library, prevents other usages
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.