Closed (won't fix)
Project:
Drupal core
Version:
7.x-dev
Component:
javascript
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
28 Jun 2006 at 01:13 UTC
Updated:
11 Jan 2010 at 17:39 UTC
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.
| Comment | File | Size | Author |
|---|---|---|---|
| textarea_0.js | 3.83 KB | stefano@tipic.com |
Comments
Comment #1
LAsan commentedWhat's this task situation?
Moving to cvs.
Comment #2
casey commentedWe use jQuery now, so selecting the grippy and wrapper should be easy enough using their classnames.