google-code-export / lwrte

Automatically exported from code.google.com/p/lwrte
1 stars 0 forks source link

Editor command contentReadOnly don't work in Chromium #52

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In the function lwRTE.prototype.enable_design_mode I save the ReadOnly 
textarea's attribute with var crtgReadOnly = 
$(self.textarea).attr('readOnly'); before set null to self.textarea.
2. After self.iframe_doc.write(doc); I question about crtgReadOnly and exec 
self.editor_cmd('contentReadOnly', crtgReadOnly); and don't activate the 
toolbar.

The expected result is that the editable box will be in Read Only mode. 

In Firefox runs well.

I suspect that the problem is in Chromium, don't in the (very good tool) 
lwrte.

I'm using Chromium 5.0.352.0 (41386) Ubuntu

Is there a workarround to make the box editor ReadOnly? Can you implements 
some like this in the core?

a lot of thanks!

kind regards
Àlex Corretgé

Original issue reported on code.google.com by corretge...@gmail.com on 14 Mar 2010 at 10:30

GoogleCodeExporter commented 9 years ago
I try this workarround and runs fine :-)

    /**
     * si la textarea és ReadOnly, li passem un contentReadOnly
     */
    if (crtgReadOnly)
    {
        self.editor_cmd('contentReadOnly', crtgReadOnly);
        /**
         * workarround per al Chrome que no li agrada el contentReadOnly
         */
        $(self.iframe_doc).keydown(function(event) {
            return false;
        });

    }
    else
    {
        if(!self.toolbars.rte)
            self.toolbars.rte   = 
self.create_toolbar(self.controls.rte);

        self.activate_toolbar(self.iframe, self.toolbars.rte);
    }

Original comment by corretge...@gmail.com on 14 Mar 2010 at 10:42