How can I change the default height of a JQTE editor?
I've tried:
$("textarea").jqte({
height:"400px"
});
The document does not say anything about this.
The height() method sets or returns the height of the selected elements. When this method is used to return height, it returns the height of the FIRST matched element.
Set the height: $ (selector).height (value) Set the height using a function: $ (selector).height (function (index,currentheight))
Definition and Usage. The height property sets the height of an element. The height of an element does not include padding, borders, or margins! If height: auto; the element will automatically adjust its height to allow its content to be displayed correctly. If height is set to a numeric value (like pixels, (r)em,...
If I select the entire sheet and then select "Autofit row height," the rows having only one line of text will default to 12.75 points. I would like that default to be bigger, say 15.75, so that there's a little more white space (easier to read).
You should try changing the min-height value for jqte_editor in jqte stylesheet:
/* editor area */
.jqte_editor, .jqte_source {
min-height:300px;
}
To lock editors height so a scrollbar appears instead of the editor expanding, you need to set .jqte_editor
height
or min-height
. You also need to set max-height
.
What happends next is a jqte bug:
.jqte_editor
height values and pushes every element (text) beneath further downFix (jqte version 1.4.0)
Open the javascript file jquery-te-1.4.0.js
.
Search and find function affectStyleAround(element,style)
Replace:
if(selectedTag && style==false)
{
// apply to the selected node with parent tag's styles
if(selectedTag.parent().is("[style]"))
selectedTag.attr("style",selectedTag.parent().attr("style"));
// apply to child tags with parent tag's styles
if(selectedTag.is("[style]"))
selectedTag.find("*").attr("style",selectedTag.attr("style"));
}
With this:
if(selectedTag && style==false)
{
// apply to the selected node with parent tag's styles
if(selectedTag.parent().is("[style]") && !selectedTag.parent().is(".jqte_editor"))
selectedTag.attr("style",selectedTag.parent().attr("style"));
// apply to child tags with parent tag's styles
if(selectedTag.is("[style]") && !selectedTag.parent().is(".jqte_editor"))
selectedTag.find("*").attr("style",selectedTag.attr("style"));
}
Notice the added code:
&& !selectedTag.parent().is(".jqte_editor")
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With