This commit is contained in:
daihere 2017-07-19 19:13:52 +08:00
parent c245702fef
commit ad98e29da0

View File

@ -110,7 +110,7 @@ function createIcon(options, enableTooltips, shortcuts) {
// create element hook // create element hook
if(options.whenEleCreate && typeof options.whenEleCreate === "function") { if(options.whenEleCreate && typeof options.whenEleCreate === "function") {
el = options.whenEleCreate(el); el = options.whenEleCreate.call(this, el);
} }
el.tabIndex = -1; el.tabIndex = -1;
@ -1450,6 +1450,9 @@ function SimpleMDE(options) {
} }
} }
// support replaceSelection to user
SimpleMDE.prototype.replaceSelection = _replaceSelection;
/** /**
* Default markdown render. * Default markdown render.
*/ */
@ -1777,7 +1780,7 @@ SimpleMDE.prototype.createToolbar = function(items) {
if(item === "|") { if(item === "|") {
el = createSep(); el = createSep();
} else { } else {
el = createIcon(item, self.options.toolbarTips, self.options.shortcuts); el = createIcon.call(self, item, self.options.toolbarTips, self.options.shortcuts);
} }
// bind events, special for info // bind events, special for info