Skip to content

Commit 55dae62

Browse files
committed
Remove alert call from emacs demo
It was causing strange event-handling artifacts on windows.
1 parent 802d41d commit 55dae62

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

demo/emacs.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ <h1>CodeMirror 2: Emacs bindings demo</h1>
4343
or open a new window.</p>
4444

4545
<script>
46-
CodeMirror.commands.save = function(){alert("Saving");};
47-
CodeMirror.fromTextArea(document.getElementById("code"), {
46+
CodeMirror.commands.save = function() {
47+
var elt = editor.getWrapperElement();
48+
elt.style.background = "#def";
49+
setTimeout(function() { elt.style.background = ""; }, 300);
50+
};
51+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
4852
lineNumbers: true,
4953
mode: "text/x-csrc",
5054
keyMap: "emacs"

0 commit comments

Comments
 (0)