I'm trying to figure out how to prevent the browser from displaying the save dialog with a ctrl-s or cmd-s event in Codemirror. I can get the extraKeys to work, I just can't get it to avoid calling resuming the event. I've tried return false and I've dug through the documentation and samples. Does anyone know how to prevent the default from happening?
Here's the code:
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true, mode: "text/html",
extraKeys: {
"Ctrl-S": function (instance) {
alert("your mom");
return false;
},
"Cmd-S": function (instance) {
alert("my mom");
return false;
}
}
});