mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-07-02 23:54:28 -06:00
New hide icons option
This commit is contained in:
parent
0b48f1dc01
commit
a93f7a2570
@ -66,6 +66,7 @@ simplemde.value("This text will appear in the editor");
|
|||||||
- **delay**: Delay between saves, in milliseconds. Defaults to `10000` (10s).
|
- **delay**: Delay between saves, in milliseconds. Defaults to `10000` (10s).
|
||||||
- **unique_id**: You must set a unique identifier so that SimpleMDE can autosave. Something that separates this from other textareas.
|
- **unique_id**: You must set a unique identifier so that SimpleMDE can autosave. Something that separates this from other textareas.
|
||||||
- **element**: The DOM element for the textarea to use. Defaults to the first textarea on the page.
|
- **element**: The DOM element for the textarea to use. Defaults to the first textarea on the page.
|
||||||
|
- **hideIcons**: An array of icon names to hide. Can be used to hide specific icons without completely customizing the toolbar.
|
||||||
- **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.
|
- **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.
|
||||||
- **initialValue**: If set, will customize the initial value of the editor.
|
- **initialValue**: If set, will customize the initial value of the editor.
|
||||||
- **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`.
|
- **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`.
|
||||||
@ -80,7 +81,6 @@ simplemde.value("This text will appear in the editor");
|
|||||||
- Optionally, you can set an array of status bar elements to include, and in what order.
|
- Optionally, you can set an array of status bar elements to include, and in what order.
|
||||||
- **tabSize**: If set, customize the tab size. Defaults to `2`.
|
- **tabSize**: If set, customize the tab size. Defaults to `2`.
|
||||||
- **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons).
|
- **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons).
|
||||||
- **toolbarGuideIcon**: If set to `false`, disable guide icon in the toolbar. Defaults to `true`.
|
|
||||||
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
|
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
|
||||||
|
|
||||||
```JavaScript
|
```JavaScript
|
||||||
@ -92,6 +92,7 @@ var simplemde = new SimpleMDE({
|
|||||||
delay: 1000,
|
delay: 1000,
|
||||||
},
|
},
|
||||||
element: document.getElementById("MyID"),
|
element: document.getElementById("MyID"),
|
||||||
|
hideIcons: ["guide", "heading"],
|
||||||
indentWithTabs: false,
|
indentWithTabs: false,
|
||||||
initialValue: "Hello world!",
|
initialValue: "Hello world!",
|
||||||
lineWrapping: false,
|
lineWrapping: false,
|
||||||
@ -116,7 +117,6 @@ var simplemde = new SimpleMDE({
|
|||||||
status: ['autosave', 'lines', 'words', 'cursor'], // Optional usage
|
status: ['autosave', 'lines', 'words', 'cursor'], // Optional usage
|
||||||
tabSize: 4,
|
tabSize: 4,
|
||||||
toolbar: false,
|
toolbar: false,
|
||||||
toolbarGuideIcon: false,
|
|
||||||
toolbarTips: false,
|
toolbarTips: false,
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
@ -1034,6 +1034,9 @@ SimpleMDE.prototype.createToolbar = function(items) {
|
|||||||
if(items[i].name == "guide" && self.options.toolbarGuideIcon === false)
|
if(items[i].name == "guide" && self.options.toolbarGuideIcon === false)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if(self.options.hideIcons.indexOf(items[i].name) != -1)
|
||||||
|
continue;
|
||||||
|
|
||||||
(function(item) {
|
(function(item) {
|
||||||
var el;
|
var el;
|
||||||
if(item === '|') {
|
if(item === '|') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user