@@ -69,7 +69,8 @@ window.addEventListener("load", () => {
69
69
"Ctrl-Enter" ( cm ) { runCode ( cm . state . context ) } ,
70
70
"Cmd-Enter" ( cm ) { runCode ( cm . state . context ) } ,
71
71
"Ctrl-`" ( cm ) { closeCode ( cm . state . context ) } ,
72
- "Ctrl-Q" : resetSandbox
72
+ "Ctrl-X" ( cm ) { resetSandbox ( cm . state . context . sandbox ) } ,
73
+ "Cmd-X" ( cm ) { resetSandbox ( cm . state . context . sandbox ) }
73
74
}
74
75
75
76
let nextID = 0
@@ -130,9 +131,9 @@ window.addEventListener("load", () => {
130
131
131
132
function openMenu ( data , node ) {
132
133
let menu = elt ( "div" , { "class" : "sandbox-open-menu" } )
133
- let items = [ [ "Run code (ctrl-enter)" , ( ) => runCode ( data ) ] ,
134
+ let items = [ [ "Run code (ctrl/cmd -enter)" , ( ) => runCode ( data ) ] ,
134
135
[ "Revert to original code" , ( ) => revertCode ( data ) ] ,
135
- [ "Reset sandbox (ctrl-q )" , ( ) => resetSandbox ( data . sandbox ) ] ]
136
+ [ "Reset sandbox (ctrl/cmd-x )" , ( ) => resetSandbox ( data . sandbox ) ] ]
136
137
if ( ! data . isHTML || ! data . sandbox )
137
138
items . push ( [ "Deactivate editor (ctrl-`)" , ( ) => { closeCode ( data ) } ] )
138
139
items . forEach ( choice => menu . appendChild ( elt ( "div" , choice [ 0 ] ) ) )
@@ -206,7 +207,6 @@ window.addEventListener("load", () => {
206
207
}
207
208
208
209
function resetSandbox ( name ) {
209
- name = name || "null"
210
210
if ( ! sandboxes . hasOwnProperty ( name ) ) return
211
211
let frame = sandboxes [ name ] . frame
212
212
frame . parentNode . removeChild ( frame )
0 commit comments