#255 closed enhancement (fixed)
No way to set minHeight of richtext when instantiating Editor
Reported by: | Martin Scheffler | Owned by: | anonymous |
---|---|---|---|
Priority: | lowest | Milestone: | |
Component: | Widgets | Version: | 0.2 |
Keywords: | minHeight, Editor | Cc: | |
Blocked By: | Blocking: |
Description
it is not possible to set minHeight when instantiating the editor with dojo.widget.fromScript. It should look something like this: editorArgs = { items: ["textGroup", "linkGroup"], minHeight:"300px"}; this.editor = dojo.widget.fromScript("Editor", editorArgs, dojo.byId("the_editor"));
This is needed because when the editor has just a single line of height, it is hard to drag&drop html to it.
Change History (4)
comment:1 Changed 15 years ago by
Priority: | low → lowest |
---|---|
severity: | minor → enhancement |
comment:2 Changed 15 years ago by
Milestone: | 0.2release → 0.3release |
---|
Dojo does not pollute the Function object prototype and uses dojo.lang.hitch() instead. Additionally, the Editor component calls functions which we can interecept and/or listen to using dojo.event.connect(). The (much safer) Dojo way to write this would be:
var doOnCreate = dojo.lang.hitch(this.editor, function(){ Â Â var h=80; Â Â this._richText.minHeight=h+"px"; Â Â this._richText.editNode.style.height=h+"px"; Â Â if(this._richText.iframe) { Â Â Â this._richText._lastHeight=h; Â Â Â this._richText.iframe.height =h+"px"; Â Â } }); // only call this method when the editor is available dojo.event.connect(this.editor, "fillInTemplate", "doOnCreate");
comment:3 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Looks like a solution was provided to me on how to accomplish this.
This is a hack to set the height without an api function.
function() {
}.bind(this.editor)
the bind function is from the prototype library, I am not fluent in dojo but I am sure there is an equivalent. Bind() sets the context in that the function will be executed.
I had to start this function with a window.setTimeout of 1000, because the iframe is not existent onload.