From f21cca3068dde482eab1cedcdcdadad46afcd9c9 Mon Sep 17 00:00:00 2001 From: Jason Butz Date: Fri, 3 Jun 2016 09:07:15 -0400 Subject: [PATCH 1/2] 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") { From 7187fb26fb7b0898ca7244def126e37b5eb9e53f Mon Sep 17 00:00:00 2001 From: Jason Butz Date: Fri, 3 Jun 2016 09:09:33 -0400 Subject: [PATCH 2/2] Adjust whitespace characters --- src/js/simplemde.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/simplemde.js b/src/js/simplemde.js index aba9202..e6a084d 100644 --- a/src/js/simplemde.js +++ b/src/js/simplemde.js @@ -1697,7 +1697,7 @@ SimpleMDE.prototype.createToolbar = function(items) { if(item.action) { if(typeof item.action === "function") { el.onclick = function(e) { - e.preventDefault(); + e.preventDefault(); item.action(self); }; } else if(typeof item.action === "string") {