mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-06-29 02:40:16 +02:00
Merge pull request #373 from jonatanklosko/min-height-option
Add an option indicating a minimal height of the editable area.
This commit is contained in:
commit
c76d4d4641
|
@ -88,6 +88,7 @@ simplemde.value("This text will appear in the editor");
|
|||
- link
|
||||
- table
|
||||
- **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`.
|
||||
- **minHeight**: A minimal height of the editable area. Should be a string containing a valid CSS value like: `"400px"`. Dafaults to `"300px"`.
|
||||
- **parsingConfig**: Adjust settings for parsing the Markdown during editing (not previewing).
|
||||
- **allowAtxHeaderWithoutSpace**: If set to `true`, will render headers without a space after the `#`. Defaults to `false`.
|
||||
- **strikethrough**: If set to `false`, will not process GFM strikethrough syntax. Defaults to `true`.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
.CodeMirror {
|
||||
height: auto;
|
||||
min-height: 300px;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
|
@ -9,10 +8,6 @@
|
|||
z-index: 1;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
min-height: 300px
|
||||
}
|
||||
|
||||
.CodeMirror-fullscreen {
|
||||
background: #fff;
|
||||
position: fixed !important;
|
||||
|
|
|
@ -1364,6 +1364,8 @@ function SimpleMDE(options) {
|
|||
// Merging the shortcuts, with the given options
|
||||
options.shortcuts = extend({}, shortcuts, options.shortcuts || {});
|
||||
|
||||
options.minHeight = options.minHeight || "300px";
|
||||
|
||||
|
||||
// Change unique_id to uniqueId for backwards compatibility
|
||||
if(options.autosave != undefined && options.autosave.unique_id != undefined && options.autosave.unique_id != "")
|
||||
|
@ -1499,6 +1501,8 @@ SimpleMDE.prototype.render = function(el) {
|
|||
styleSelectedText: (options.styleSelectedText != undefined) ? options.styleSelectedText : true
|
||||
});
|
||||
|
||||
this.codemirror.getScrollerElement().style.minHeight = options.minHeight;
|
||||
|
||||
if(options.forceSync === true) {
|
||||
var cm = this.codemirror;
|
||||
cm.on("change", function() {
|
||||
|
|
Loading…
Reference in a new issue