aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-04-04 06:31:49 +0100
committerStephen Blott2016-04-04 06:31:52 +0100
commit240433c3b50fc01e72d840b4b6062334e208b59a (patch)
treec6b50d186fc1c709148c37a64b529440132ba57b
parentcc4e02d04adb60743fe20102ec40324aa622bcd1 (diff)
downloadvimium-240433c3b50fc01e72d840b4b6062334e208b59a.tar.bz2
Do not offer activated element as scrollable.
Scrollable divs are offered via link hints. It makes no sense to offer the current activated element for selection - so don't. On a "normal" page where there's just one scrollable thing, document.body, this means that we no longer offer the unnecessary "Scroll." hint.
-rw-r--r--content_scripts/scroller.coffee4
1 files changed, 3 insertions, 1 deletions
diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee
index 7b46bab0..6965f706 100644
--- a/content_scripts/scroller.coffee
+++ b/content_scripts/scroller.coffee
@@ -259,8 +259,10 @@ Scroller =
amount = getDimension(element,direction,pos) - element[scrollProperties[direction].axisName]
CoreScroller.scroll element, direction, amount
+ # Is element scrollable and not the activated element?
isScrollableElement: (element) ->
- isScrollableElement element
+ activatedElement ||= (document.body and firstScrollableElement()) or document.body
+ element != activatedElement and isScrollableElement element
# Scroll the top, bottom, left and right of element into view. The is used by visual mode to ensure the
# focus remains visible.