overleaf/services/web/public/coffee/ide/hotkeys/BackspaceHighjack.coffee
Henry Oswald 9c2cca1372 Added the old backspace highjack back in.
It uses jquery and works well. There may be an angular way todo this
but the jquery way seemed cleanest to me.
2014-07-23 14:40:01 +01:00

9 lines
No EOL
229 B
CoffeeScript

define [
], () ->
rx = /INPUT|SELECT|TEXTAREA/i
$(document).bind "keydown keypress", (e)->
if e.which == 8
# 8 == backspace
if !rx.test(e.target.tagName) || e.target.disabled || e.target.readOnly
e.preventDefault()