diff options
| author | Stephen Blott | 2015-01-18 11:29:08 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-01-18 11:29:08 +0000 |
| commit | 9c572b3863018c4cc8ed11a1e43aa7b7e76cc281 (patch) | |
| tree | 6c4c42b8c5b08be7349bbc63d5b4548881fb4bd4 /lib | |
| parent | cd27269568380049425b9a0a2baab51311fca769 (diff) | |
| parent | 0f2343dbc73b4bbca856b777b8a3c11b0cffd2cd (diff) | |
| download | vimium-9c572b3863018c4cc8ed11a1e43aa7b7e76cc281.tar.bz2 | |
Merge branch 'master' into fix-simulate-select
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dom_utils.coffee | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index 2cf94a14..af563fd1 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -176,6 +176,11 @@ DomUtils = element.selectionStart? and element.selectionEnd? and element.selectionStart != element.selectionEnd simulateSelect: (element) -> + # If element == document.activeElement, then we won't get a new focus event. So, we pretend (to any + # active modes which care, e.g. PostFindMode) that element has been clicked. + if element == document.activeElement and DomUtils.isEditable document.activeElement + handlerStack.bubbleEvent "click", target: element + element.focus() unless @isSelected element # When focusing a textbox, put the selection caret at the end of the textbox's contents. |
