diff --git a/services/web/public/coffee/ide/hotkeys/BackspaceHighjack.coffee b/services/web/public/coffee/ide/hotkeys/BackspaceHighjack.coffee new file mode 100644 index 0000000000..b3fcf1cce1 --- /dev/null +++ b/services/web/public/coffee/ide/hotkeys/BackspaceHighjack.coffee @@ -0,0 +1,9 @@ +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() \ No newline at end of file diff --git a/services/web/public/coffee/ide/hotkeys/index.coffee b/services/web/public/coffee/ide/hotkeys/index.coffee index acc7577c6d..7de8bd990f 100644 --- a/services/web/public/coffee/ide/hotkeys/index.coffee +++ b/services/web/public/coffee/ide/hotkeys/index.coffee @@ -1,3 +1,4 @@ define [ + "ide/hotkeys/BackspaceHighjack" "ide/hotkeys/controllers/HotkeysController" ], () -> \ No newline at end of file