Update built in toolbar buttons

pull/65/head
Wes Cossick 9 years ago
parent 6cf9161034
commit daf2c453f6

@ -452,7 +452,7 @@ function wordCount(data) {
} }
var toolbarDefaults = { var toolbarBuiltInButtons = {
"bold": { "bold": {
name: "bold", name: "bold",
action: toggleBold, action: toggleBold,
@ -472,16 +472,22 @@ var toolbarDefaults = {
title: "Heading (Ctrl+H)", title: "Heading (Ctrl+H)",
}, },
"heading-smaller": { "heading-smaller": {
name: "headingSmaller", name: "heading-smaller",
action: toggleHeadingSmaller, action: toggleHeadingSmaller,
className: "fa fa-lg fa-header", className: "fa fa-header",
title: "Heading (Ctrl+H)", title: "Smaller Heading (Ctrl+H)",
}, },
"heading-bigger": { "heading-bigger": {
name: "headingBigger", name: "heading-bigger",
action: toggleHeadingBigger, action: toggleHeadingBigger,
className: "fa fa-header", className: "fa fa-lg fa-header",
title: "Heading (Shift+Ctrl+H)", title: "Bigger Heading (Shift+Ctrl+H)",
},
"code": {
name: "code",
action: toggleCodeBlock,
className: "fa fa-code",
title: "Code (Ctrl+Alt+C)",
}, },
"quote": { "quote": {
name: "quote", name: "quote",
@ -715,8 +721,8 @@ SimpleMDE.prototype.createToolbar = function(items) {
} }
for(var i = 0; i < items.length; i++) { for(var i = 0; i < items.length; i++) {
if(toolbarDefaults[items[i]] != undefined){ if(toolbarBuiltInButtons[items[i]] != undefined){
items[i] = toolbarDefaults[items[i]]; items[i] = toolbarBuiltInButtons[items[i]];
} }
} }
@ -903,4 +909,4 @@ SimpleMDE.prototype.togglePreview = function() {
}; };
SimpleMDE.prototype.toggleFullScreen = function() { SimpleMDE.prototype.toggleFullScreen = function() {
toggleFullScreen(this); toggleFullScreen(this);
}; };

Loading…
Cancel
Save