Prevent onclick event from bubbling

This commit is contained in:
Jason Butz 2016-06-03 09:07:15 -04:00
parent b6b1f7c1ef
commit f21cca3068

View file

@ -1696,7 +1696,8 @@ SimpleMDE.prototype.createToolbar = function(items) {
// bind events, special for info // bind events, special for info
if(item.action) { if(item.action) {
if(typeof item.action === "function") { if(typeof item.action === "function") {
el.onclick = function() { el.onclick = function(e) {
e.preventDefault();
item.action(self); item.action(self);
}; };
} else if(typeof item.action === "string") { } else if(typeof item.action === "string") {