Skip to content

Commit 21ad5cf

Browse files
committed
Fixed toolbar buttons should prevent default event
1 parent 3d21e6b commit 21ad5cf

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

public/js/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,9 @@ var url = window.location.protocol + '//' + window.location.host + window.locati
799799
ui.toolbar.publish.attr("href", url + "/publish");
800800
//download
801801
//markdown
802-
ui.toolbar.download.markdown.click(function () {
802+
ui.toolbar.download.markdown.click(function (e) {
803+
e.preventDefault();
804+
e.stopPropagation();
803805
var filename = renderFilename(ui.area.markdown) + '.md';
804806
var markdown = editor.getValue();
805807
var blob = new Blob([markdown], {
@@ -808,7 +810,9 @@ ui.toolbar.download.markdown.click(function () {
808810
saveAs(blob, filename);
809811
});
810812
//html
811-
ui.toolbar.download.html.click(function () {
813+
ui.toolbar.download.html.click(function (e) {
814+
e.preventDefault();
815+
e.stopPropagation();
812816
exportToHTML(ui.area.markdown);
813817
});
814818
//export to dropbox

0 commit comments

Comments
 (0)