8000 multiple editors in tbody grey out under jQuery 1.7.1 after hide() · Issue #20 · cleditor/cleditor · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

multiple editors in tbody grey out under jQuery 1.7.1 after hide() #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
timsassen opened this issue Apr 3, 2012 · 1 comment
Open

Comments

@timsassen
Copy link

I've got a table with numerous tbody elements in it. These tbody elements represent a product in my application. I need to hide() and show() these tbody elements so that one tbody is visible at a given time. Each tbody can contain 0 or more cleditors.

When my application loads the cleditors on the first tbody (init), all cleditors are rendered fine. But when I start using hide() and show() on the tbody elements (which are basically their containers) only the first cleditor is rendered as it should. All other cleditors in the tbody are greyed out. See the image for an example of a greyed out cleditor.

Image and video hosting by TinyPic

This is the code that initializes a collection of textarea's. This function is run each time a tbody is shown using show()

  • jqObjectCollection is the jquery collection of textarea-elements
  • The change function at the end is to trigger the change event bound to the textarea element.
function initCLE(jqObjectCollection){  
    $editors = null;
    $editors = $(jqObjectCollection).cleditor({
      width:        500, // width not including margins, borders or padding
      height:       200, // height not including margins, borders or padding
      controls:     // controls to add to the toolbar
                    "bold italic underline strikethrough subscript superscript | font size " +
                    "style | color highlight removeformat | bullets numbering | outdent " +
                    "indent | alignleft center alignright justify | undo redo | " +
                    "rule image link unlink | cut copy paste pastetext | print source",
      sizes:        // sizes in the font size popup
                    "1,2,3,4,5,6,7",
      styles:       // styles in the style popup
                    [["Paragraph", "<p>"], ["Header 1", "<h1>"], ["Header 2", "<h2>"],
                    ["Header 3", "<h3>"],  ["Header 4","<h4>"],  ["Header 5","<h5>"],
                    ["Header 6","<h6>"]],
      useCSS:       false, // use CSS to style HTML when possible (not supported in ie)
      docType:      // Document type contained within the editor
                    '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
      docCSSFile:   // CSS file used to style the document contained within the editor
                    "", 
      bodyStyle:    // style to assign to document body contained within the editor
                    "margin:4px; font:10pt Arial,Verdana; cursor:text"

    }).change(function(){ 
        $(this.$area[0]).change();
    });
}

This code works fine when using jquery 1.6.4, but fails under 1.7.1

@funivan
Copy link
funivan commented May 28, 2012

Hi. I find solution fot this bug.

jquery.cleditor.css line 4:

.cleditorToolbar {background: url('images/toolbar.gif') repeat; float: left;position:relative;width:100%;}

And comment this lines
jquery.cleditor.js lint 895 and 896:

//var hgt = $group.offset().top + $group.outerHeight() - $toolbar.offset().top + 1;
//$toolbar.height(hgt);

Please test it. In Google Chrome 19.0 all works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0