I've been working on a patch to fckeditor.module, that allows a resizable textarea to be replaced with the wysiwyg editor. Since all textarea are esizable by default, I needed to make the grippie disappear and I also needed to restore a proper height for the wrapper that is added around the original textarea. For this reason, wrapper and grippie must have their own id's. This is how i patched function textArea(element) in textarea.js:

  ..........................
  // Prepare wrapper
  this.wrapper = document.createElement('div');
  this.wrapper.className = 'resizable-textarea';
  this.wrapper.id = element.name + '-wrapper';  // <-- set wrapper ID
  this.parent.insertBefore(this.wrapper, this.element);

  // Add grippie and measure it
  this.grippie = document.createElement('div');
  this.grippie.className = 'grippie';
  this.grippie.id = element.name + '-grippie';  // <-- set grippie ID
  ..........................

This gives every textarea a unique ID, that is used in my javascript textarea replace function to retrieve wrapper+grippie for the specific textarea. Below is the code I use in the javascript function:

var obj = $(name + "-wrapper");
if (obj) obj.style.height = "auto";
var obj = $(name + "-grippie");
if (obj) obj.style.display = "none";

Patched textarea.js attached.

CommentFileSizeAuthor
textarea_0.js3.83 KBstefano@tipic.com

Comments

LAsan’s picture

Version: x.y.z » 7.x-dev

What's this task situation?

Moving to cvs.

casey’s picture

Status: Active » Closed (won't fix)

We use jQuery now, so selecting the grippy and wrapper should be easy enough using their classnames.