mirror of https://github.com/vector-im/riot-web
More comments; remove redundant if statement
parent
095f82feee
commit
b80015c69c
|
@ -140,17 +140,15 @@ class TabComplete {
|
||||||
this.inPassiveMode = ev.passive;
|
this.inPassiveMode = ev.passive;
|
||||||
|
|
||||||
if (ev.keyCode !== KEY_TAB) {
|
if (ev.keyCode !== KEY_TAB) {
|
||||||
|
// pressing any key (except shift, windows, cmd (OSX) and ctrl/alt combinations)
|
||||||
|
// aborts the current tab completion
|
||||||
if (this.completing && ev.keyCode !== KEY_SHIFT &&
|
if (this.completing && ev.keyCode !== KEY_SHIFT &&
|
||||||
!ev.metaKey && !ev.ctrlKey && !ev.altKey && ev.keyCode !== KEY_WINDOWS) {
|
!ev.metaKey && !ev.ctrlKey && !ev.altKey && ev.keyCode !== KEY_WINDOWS) {
|
||||||
// they're resuming typing; reset tab complete state vars.
|
// they're resuming typing; reset tab complete state vars.
|
||||||
this.stopTabCompleting();
|
this.stopTabCompleting();
|
||||||
|
|
||||||
// fall through to auto-enter-tab-completing if set
|
|
||||||
if (!this.opts.autoEnterTabComplete) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pressing any key at all (except tab) restarts the automatic tab-complete timer
|
||||||
if (this.opts.autoEnterTabComplete) {
|
if (this.opts.autoEnterTabComplete) {
|
||||||
clearTimeout(this.enterTabCompleteTimerId);
|
clearTimeout(this.enterTabCompleteTimerId);
|
||||||
this.enterTabCompleteTimerId = setTimeout(() => {
|
this.enterTabCompleteTimerId = setTimeout(() => {
|
||||||
|
@ -170,6 +168,8 @@ class TabComplete {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// tab key has been pressed at this point
|
||||||
|
|
||||||
if (!this.textArea) {
|
if (!this.textArea) {
|
||||||
console.error("onKeyDown called before a <textarea> was set!");
|
console.error("onKeyDown called before a <textarea> was set!");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue