From 21ad5cfd601c7420a6990b65dcbb42ca7b41d1ad Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Fri, 18 Dec 2015 09:44:08 -0600 Subject: [PATCH] Fixed toolbar buttons should prevent default event --- public/js/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index d3c02b1..1e4bc9f 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -799,7 +799,9 @@ var url = window.location.protocol + '//' + window.location.host + window.locati ui.toolbar.publish.attr("href", url + "/publish"); //download //markdown -ui.toolbar.download.markdown.click(function () { +ui.toolbar.download.markdown.click(function (e) { + e.preventDefault(); + e.stopPropagation(); var filename = renderFilename(ui.area.markdown) + '.md'; var markdown = editor.getValue(); var blob = new Blob([markdown], { @@ -808,7 +810,9 @@ ui.toolbar.download.markdown.click(function () { saveAs(blob, filename); }); //html -ui.toolbar.download.html.click(function () { +ui.toolbar.download.html.click(function (e) { + e.preventDefault(); + e.stopPropagation(); exportToHTML(ui.area.markdown); }); //export to dropbox