summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2015-12-18 09:44:08 -0600
committerWu Cheng-Han2015-12-18 09:44:08 -0600
commit21ad5cfd601c7420a6990b65dcbb42ca7b41d1ad (patch)
tree0477ad791b5b649d249ff67f440553f594125e07
parent3d21e6b16dd8ddbed0159b0cff7888190f808423 (diff)
Fixed toolbar buttons should prevent default event
Diffstat (limited to '')
-rw-r--r--public/js/index.js8
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