added exit shortcut for codemirror
This commit is contained in:
parent
ef60a24535
commit
f69653a0a9
|
@ -5,3 +5,4 @@ me="$(dirname $(readlink -f $0))"
|
||||||
file="$(readlink -f "$1")"
|
file="$(readlink -f "$1")"
|
||||||
|
|
||||||
$me/codemirror.js "$file"
|
$me/codemirror.js "$file"
|
||||||
|
echo "press ctrl-X to exit editor"
|
||||||
|
|
|
@ -87,6 +87,11 @@ AFRAME.registerComponent('codemirror', {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.editor.setOption("theme", "shadowfox")
|
this.editor.setOption("theme", "shadowfox")
|
||||||
|
this.editor.setOption("extraKeys", {
|
||||||
|
"Ctrl-X": (cm) => {
|
||||||
|
this.el.emit('close',true) // window.js will react accordingly
|
||||||
|
}
|
||||||
|
})
|
||||||
this.editor.updateFile = AFRAME.utils.throttle( (file,str) => {
|
this.editor.updateFile = AFRAME.utils.throttle( (file,str) => {
|
||||||
this.updateFile(file,str)
|
this.updateFile(file,str)
|
||||||
}, 1500)
|
}, 1500)
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue