Changing the rows attribute when editing a wysiwyg field's config does not change the height of the editor.
The same issue existed for the stand alone CKeditor: https://www.drupal.org/node/1154730
This issue can be fixed by editing wysiwyg.module and in the wysiwyg_pre_render_text_format function and finding this code
$settings[$format] = array(
'editor' => 'none',
'status' => 1,
'toggle' => 1,
'resizable' => $resizable,
);
and adding this underneath:
// Set editor height based on the number of rows
if(isset($element['#rows'])) {
$settings[$format]['rows'] = $element['#rows'];
}
And then also editing ckeditor-3.0.js and in Drupal.wysiwyg.editor.attach.ckeditor function adding the line
settings.height = params.rows * 23;
directly under:
var $drupalToolbar = $('#toolbar', Drupal.overlayChild ? window.parent.document : document);
I've not tested the dev version of the module as I can't use a dev release on my current project. Sorry this is not a patch.
Comment | File | Size | Author |
---|---|---|---|
#9 | wysiwyg-heights.2410565.9.patch | 2.35 KB | Delphine Lepers |
#5 | wysiwyg-heights.2410565.5.patch | 2.32 KB | TwoD |
#2 | wysiwyg-ckeditor_rows-2410565-2.patch | 1.43 KB | brockfanning |
Comments
Comment #1
dahousecat CreditAttribution: dahousecat commentedComment #2
brockfanning CreditAttribution: brockfanning commentedI'm not totally sure this is the best way to go about this, but here is a patch along the lines of what @dahousecat suggests. It's working for me in the dev version, using CKEditor.
Comment #3
brockfanning CreditAttribution: brockfanning commentedComment #4
erwangel CreditAttribution: erwangel commentedpatch #2 did'nt work for me (on 7x-2.2) but following the initial instructions did it.
@brockfanning: "if (isset($element['#rows'])) {..." needs to stay inside the "foreach ($format_field['format']['#options']..." in order to hold values for all textarea fields (in case a node has more than one)
Inspired by patch#2 I added a test for indefined value to the initial post, so it becomes:
Comment #5
TwoDI don't think we need to pass the row setting down from the server, and there's a slight chance it'll get ignored or altered in the theme anyway.
How about just accessing the rows attribute (if there), use it if possible, or fall back to a minimum usable height?
Btw, since the editors handle small heights differently, I used different calculations.
CKEditor uses the setting for its inner height, FCKeditor and EpicEditor use it for the total height. EpicEditor has no toolbar so it can go much smaller than the other two while still being usable.
The others do fairly well on their own, but I forgot about YUI. I'll simply add that before committing.
Comment #6
pianomansam CreditAttribution: pianomansam commentedIt looks like this is a duplicate of #507696: Allow individual width/height per field
Comment #7
geek-merlinComment #8
yemoko CreditAttribution: yemoko commentedHi,
patch #5 works for me (on 7x-2.2).
I had issue when changing vertical tabs selection after increasing height on the interface.
Comment #9
Delphine Lepers CreditAttribution: Delphine Lepers at European Commission and European Union Institutions, Agencies and Bodies for European Commission and European Union Institutions, Agencies and Bodies commentedNew patch for the latest release