diff options
author | Wu Cheng-Han | 2015-12-18 09:44:08 -0600 |
---|---|---|
committer | Wu Cheng-Han | 2015-12-18 09:44:08 -0600 |
commit | 21ad5cfd601c7420a6990b65dcbb42ca7b41d1ad (patch) | |
tree | 0477ad791b5b649d249ff67f440553f594125e07 | |
parent | 3d21e6b16dd8ddbed0159b0cff7888190f808423 (diff) |
Fixed toolbar buttons should prevent default event
Diffstat (limited to '')
-rw-r--r-- | public/js/index.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/public/js/index.js b/public/js/index.js index d3c02b12..1e4bc9fe 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 |