From f21cca3068dde482eab1cedcdcdadad46afcd9c9 Mon Sep 17 00:00:00 2001 From: Jason Butz Date: Fri, 3 Jun 2016 09:07:15 -0400 Subject: [PATCH] Prevent onclick event from bubbling --- src/js/simplemde.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/simplemde.js b/src/js/simplemde.js index 7961339..aba9202 100644 --- a/src/js/simplemde.js +++ b/src/js/simplemde.js @@ -1696,7 +1696,8 @@ SimpleMDE.prototype.createToolbar = function(items) { // bind events, special for info if(item.action) { if(typeof item.action === "function") { - el.onclick = function() { + el.onclick = function(e) { + e.preventDefault(); item.action(self); }; } else if(typeof item.action === "string") {