Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


Resizing of Frame in cleditor

edited April 2012 in Questions
This discussion is related to the CLEditor jQuery WYSIWYG addon.
  function ResizeEditor (editor)
  {

       //editor=$("div.cleditorMain>textarea").cleditor()[0];
       var size = 0; 

       f=editor.$frame[0];         
       temp_size = f.contentWindow.document.body.scrollHeight + 25;

       if (temp_size!=size)
       {
          size=temp_size;
          defaultsize=$.cleditor.defaultOptions.height;
          if (size<=defaultsize) size=defaultsize;

          f.style.height = size + "px";

       }   
  } 

i'm not good in javascript - but may be this code would be useful for somebody else.

    $doc.click(hidePopups)
      .bind("keypress", function(e) {
 ResizeEditor (editor)
});

Answers

  • thanks for sharing..I like to try this but don't know how? can you explain the steps where to put the script. Thank you

  • edited April 2012

    This script should be put in the file js\jquery.cleditor.min.js

    (I don't remember if it is minimied js code or not. If it is minimied then You need firstly to download plain cleditor.js and replace the old file with new not packed )

    File is placed in forum\plugins\cleditor.

    So change $doc.click in the function refresh(editor) { adding ResizeEditor-call to the key event.

    and place function ResizeEditor (editor) before any cleditor method .

    ps And insted of defaultsize=$.cleditor.defaultOptions.height; I now use defaultsize=156 :)

  • i got a resizing problemm but i don't have any knowledge about coding :( Can you show me step by step ??

    Thanks you so much

  • ffvinh, try to understand the previous post.

    I believe you can to include the code into the cleditor.js with it.

Sign In or Register to comment.