1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2024-12-21 09:12:10 -05:00
overleaf/services/web/public/coffee/ide/hotkeys/BackspaceHighjack.coffee

9 lines
229 B
CoffeeScript
Raw Normal View History

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()