mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 07:08:08 +00:00
term: remove redundant events of inputHelper and redundant contentEditable
We do not need to listen for keydown and keypress for inputHelper because these events will propagate through the parent. Listening them will be redundant and will cause some shortcut key combinations to stop working. Since we now have a hidden `textarea`, there is no longer need to set anything to contentEditable
This commit is contained in:
@@ -9,10 +9,6 @@ class Popup
|
||||
@el.innerHTML = html
|
||||
@el.classList.remove 'hidden'
|
||||
|
||||
# ff glorious hack
|
||||
if typeof InstallTrigger isnt "undefined"
|
||||
document.body.contentEditable = 'false'
|
||||
|
||||
addEventListener 'click', @bound_click_maybe_close
|
||||
addEventListener 'keydown', @bound_key_maybe_close
|
||||
|
||||
@@ -20,10 +16,6 @@ class Popup
|
||||
removeEventListener 'click', @bound_click_maybe_close
|
||||
removeEventListener 'keydown', @bound_key_maybe_close
|
||||
|
||||
# ff glorious hack
|
||||
if typeof InstallTrigger isnt "undefined"
|
||||
document.body.contentEditable = 'true'
|
||||
|
||||
@el.classList.add 'hidden'
|
||||
@el.innerHTML = ''
|
||||
|
||||
|
||||
@@ -119,10 +119,6 @@ class Terminal
|
||||
@compositionUpdate.bind(@)
|
||||
@inputHelper.addEventListener 'compositionend',
|
||||
@compositionEnd.bind(@)
|
||||
@inputHelper.addEventListener 'keydown',
|
||||
@keyDown.bind(@)
|
||||
@inputHelper.addEventListener 'keypress',
|
||||
@keyPress.bind(@)
|
||||
addEventListener 'keydown', @keyDown.bind(@)
|
||||
addEventListener 'keypress', @keyPress.bind(@)
|
||||
# Always focus on the inputHelper textarea
|
||||
|
||||
Reference in New Issue
Block a user