File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1327,6 +1327,12 @@ function SimpleMDE(options) {
1327
1327
}
1328
1328
}
1329
1329
1330
+ // Add custom toolbar actions
1331
+ if ( options . additionalToolbarButtons !== undefined ) {
1332
+ for ( var index in options . additionalToolbarButtons ) {
1333
+ options . toolbar . push ( options . additionalToolbarButtons [ index ] ) ;
1334
+ }
1335
+ }
1330
1336
1331
1337
// Handle status bar
1332
1338
if ( ! options . hasOwnProperty ( "status" ) ) {
@@ -1686,11 +1692,9 @@ SimpleMDE.prototype.createToolbar = function(items) {
1686
1692
// Don't include trailing separators
1687
1693
if ( items [ i ] === "|" ) {
1688
1694
var nonSeparatorIconsFollow = false ;
1689
-
1690
- for ( var x = ( i + 1 ) ; x < items . length ; x ++ ) {
1691
- if ( items [ x ] !== "|" && ( ! self . options . hideIcons || self . options . hideIcons . indexOf ( items [ x ] . name ) == - 1 ) ) {
1692
- nonSeparatorIconsFollow = true ;
1693
- }
1695
+ var x = Math . min ( i + 1 , items . length - 1 ) ;
1696
+ if ( items [ x ] !== "|" && ( ! self . options . hideIcons || self . options . hideIcons . indexOf ( items [ x ] . name ) == - 1 ) ) {
1697
+ nonSeparatorIconsFollow = true ;
1694
1698
}
1695
1699
1696
1700
if ( ! nonSeparatorIconsFollow )
@@ -2025,4 +2029,4 @@ SimpleMDE.prototype.toTextArea = function() {
2025
2029
}
2026
2030
} ;
2027
2031
2028
- module . exports = SimpleMDE ;
2032
+ module . exports = SimpleMDE ;
You can’t perform that action at this time.
0 commit comments