aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-09-09 14:00:54 +0100
committerGitHub2016-09-09 14:00:54 +0100
commit92bfced758957fa65ec1e8209a70d3009911fe0f (patch)
tree4727167c08cb1f9a14dfcc3e96657cc4615a952b
parent7a954b7b51b791ccf9a4d76370bf6275506e038a (diff)
parent51489b165d9639fef06660b0c992ade963f96a70 (diff)
downloadvimium-92bfced758957fa65ec1e8209a70d3009911fe0f.tar.bz2
Merge pull request #2222 from bouk/summary-hints
Add support for opening details elements
-rw-r--r--content_scripts/link_hints.coffee5
1 files changed, 5 insertions, 0 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 0f2425c3..c5fca525 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -326,6 +326,8 @@ class LinkHintsMode
else if localHintDescriptor.reason == "Scroll."
# Tell the scroller that this is the activated element.
handlerStack.bubbleEvent "DOMActivate", target: clickEl
+ else if localHintDescriptor.reason == "Open."
+ clickEl.open = !clickEl.open
else if DomUtils.isSelectable clickEl
window.focus()
DomUtils.simulateSelect clickEl
@@ -637,6 +639,9 @@ LocalHints =
isClickable ||=
if element.clientHeight < element.scrollHeight and Scroller.isScrollableElement element
reason = "Scroll."
+ when "details"
+ isClickable = true
+ reason = "Open."
# An element with a class name containing the text "button" might be clickable. However, real clickables
# are often wrapped in elements with such class names. So, when we find clickables based only on their