Skip to content

Commit

Permalink
(EasyMDE) Ctrl+Enter envoie de nouveau le message
Browse files Browse the repository at this point in the history
  • Loading branch information
Situphen committed Jan 20, 2020
1 parent 84e7c26 commit 9cd0f4e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions assets/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,20 @@
]
}
);

window.editors[this.id]=easyMDE;
window.editors[this.id].timeout = 0;
window.editors[this.id].previous_value = "";

function submit(cm) {
if (cm.getValue() !== "") formEditor.submit();
}

easyMDE.codemirror.addKeyMap({
"Ctrl-Enter": submit
})
easyMDE.codemirror.addKeyMap({
"Cmd-Enter": submit
})
});
})(jQuery);

0 comments on commit 9cd0f4e

Please sign in to comment.