mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 15:13:36 +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:
@@ -291,9 +291,6 @@
|
||||
Popup.prototype.open = function(html) {
|
||||
this.el.innerHTML = html;
|
||||
this.el.classList.remove('hidden');
|
||||
if (typeof InstallTrigger !== "undefined") {
|
||||
document.body.contentEditable = 'false';
|
||||
}
|
||||
addEventListener('click', this.bound_click_maybe_close);
|
||||
return addEventListener('keydown', this.bound_key_maybe_close);
|
||||
};
|
||||
@@ -301,9 +298,6 @@
|
||||
Popup.prototype.close = function() {
|
||||
removeEventListener('click', this.bound_click_maybe_close);
|
||||
removeEventListener('keydown', this.bound_key_maybe_close);
|
||||
if (typeof InstallTrigger !== "undefined") {
|
||||
document.body.contentEditable = 'true';
|
||||
}
|
||||
this.el.classList.add('hidden');
|
||||
return this.el.innerHTML = '';
|
||||
};
|
||||
|
||||
2
butterfly/static/ext.min.js
vendored
2
butterfly/static/ext.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -201,8 +201,6 @@
|
||||
this.inputHelper.addEventListener('compositionstart', this.compositionStart.bind(this));
|
||||
this.inputHelper.addEventListener('compositionupdate', this.compositionUpdate.bind(this));
|
||||
this.inputHelper.addEventListener('compositionend', this.compositionEnd.bind(this));
|
||||
this.inputHelper.addEventListener('keydown', this.keyDown.bind(this));
|
||||
this.inputHelper.addEventListener('keypress', this.keyPress.bind(this));
|
||||
addEventListener('keydown', this.keyDown.bind(this));
|
||||
addEventListener('keypress', this.keyPress.bind(this));
|
||||
if (!isMobile()) {
|
||||
|
||||
4
butterfly/static/main.min.js
vendored
4
butterfly/static/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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