aboutsummaryrefslogtreecommitdiffstats
path: root/vimiumFrontend.js
diff options
context:
space:
mode:
authorJez Ng2012-02-26 23:48:38 -0500
committerJez Ng2012-02-26 23:48:38 -0500
commitbd48e3671181fcd10ede588e96aa45f0d81a07d4 (patch)
tree52f024d90b199343378914063d71cc24a77a3a3a /vimiumFrontend.js
parent18d5b9f6c44f6245f01a19471a475d6fb9775fe9 (diff)
downloadvimium-bd48e3671181fcd10ede588e96aa45f0d81a07d4.tar.bz2
Revert "Exit insert mode upon tab switch. Closes #314."
This reverts commit 9e14b51f7761fa35acdbf7e5abbb7bc59928a6e2. Conflicts: vimiumFrontend.js
Diffstat (limited to 'vimiumFrontend.js')
-rw-r--r--vimiumFrontend.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index 286dfe3e..be69b87f 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -188,7 +188,7 @@ function initializeWhenEnabled() {
document.addEventListener("keypress", onKeypress, true);
document.addEventListener("keyup", onKeyup, true);
document.addEventListener("focus", onFocusCapturePhase, true);
- window.addEventListener("blur", onBlurCapturePhase, true);
+ document.addEventListener("blur", onBlurCapturePhase, true);
document.addEventListener("DOMActivate", onDOMActivate, true);
enterInsertModeIfElementIsFocused();
}
@@ -563,12 +563,7 @@ function onFocusCapturePhase(event) {
}
function onBlurCapturePhase(event) {
- if (event.target == window)
- // At this point, we will have exited insert mode already, but the browser remembers which element last
- // had focus, and fires a focus event on it when the window regains focus. We blur this element to prevent
- // implicit insert mode from reactivating when we switch back to this tab.
- document.activeElement.blur();
- else if (isFocusable(event.target))
+ if (isFocusable(event.target))
exitInsertMode(event.target);
}