如何使 dijit/editor 手动调整大小?
How to make a dijit/editor manualy resizable?
我正在尝试制作一个位于对话框中的富文本编辑器,手动调整大小(使用鼠标)。是否有任何 dojo 小部件可以实现它?
这是我的代码:
<div data-dojo-type="dijit/Dialog" data-dojo-id="myFormDialog" title="Editor">
<div class="dijitDialogPaneContentArea" data-dojo-attach-point="name">
<label id="editorLabel" for="name"><b>Insert your explanation below: </b></label>
<input id="editorInput" type="hidden" name="editorContent" data-dojo-attach-point="name" style="display:none" />
<div id="editorContent" dojoType="dijit/Editor" height="200px" extraPlugins=" ['createLink', 'unlink', 'insertImage'] "></div>
</div>
</div>
<button id="editorButton" data-dojo-type="dijit/form/Button" type="button" iconClass="dijitNoIcon" onclick="myFormDialog.show()" height="">Show Editor</button>
我没有找到 dojo 小部件,但在 css 文件中添加这一行非常有效:
.claro .dijitEditorIFrame{ resize:both; }
使用以下 CSS,它在您的 textarea
上强制执行 resize
。
textarea {
resize: both !important;
}
实例:
https://jsfiddle.net/esrcju2p/7/
您可以在此处阅读有关 resize
属性 的更多信息:http://www.w3schools.com/cssref/css3_pr_resize.asp
require(["dijit/form/Textarea", "dojo/domReady!"], function(Textarea){
var textarea = new Textarea({
style: "resize:both",
name: "myarea",
value: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.",
style: "width:200px;"
}, "myarea").startup();
});
我正在尝试制作一个位于对话框中的富文本编辑器,手动调整大小(使用鼠标)。是否有任何 dojo 小部件可以实现它?
这是我的代码:
<div data-dojo-type="dijit/Dialog" data-dojo-id="myFormDialog" title="Editor">
<div class="dijitDialogPaneContentArea" data-dojo-attach-point="name">
<label id="editorLabel" for="name"><b>Insert your explanation below: </b></label>
<input id="editorInput" type="hidden" name="editorContent" data-dojo-attach-point="name" style="display:none" />
<div id="editorContent" dojoType="dijit/Editor" height="200px" extraPlugins=" ['createLink', 'unlink', 'insertImage'] "></div>
</div>
</div>
<button id="editorButton" data-dojo-type="dijit/form/Button" type="button" iconClass="dijitNoIcon" onclick="myFormDialog.show()" height="">Show Editor</button>
我没有找到 dojo 小部件,但在 css 文件中添加这一行非常有效:
.claro .dijitEditorIFrame{ resize:both; }
使用以下 CSS,它在您的 textarea
上强制执行 resize
。
textarea {
resize: both !important;
}
实例: https://jsfiddle.net/esrcju2p/7/
您可以在此处阅读有关 resize
属性 的更多信息:http://www.w3schools.com/cssref/css3_pr_resize.asp
require(["dijit/form/Textarea", "dojo/domReady!"], function(Textarea){
var textarea = new Textarea({
style: "resize:both",
name: "myarea",
value: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.",
style: "width:200px;"
}, "myarea").startup();
});