diff options
| author | mrmr1993 | 2014-11-05 15:25:15 +0000 |
|---|---|---|
| committer | mrmr1993 | 2014-11-05 15:25:15 +0000 |
| commit | 9e8a48457d7bc2939278cc9764c23ad788ac95e7 (patch) | |
| tree | 0df0bf6f03cb4ec799977fe8f4231b82a315fe05 /content_scripts | |
| parent | 01608ce7047e3ff0e53c44842697dded489a60f0 (diff) | |
| download | vimium-9e8a48457d7bc2939278cc9764c23ad788ac95e7.tar.bz2 | |
Disable scrolling for `overflow: hidden` elements
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/scroller.coffee | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee index f3c632b3..8eb50d77 100644 --- a/content_scripts/scroller.coffee +++ b/content_scripts/scroller.coffee @@ -38,7 +38,9 @@ ensureScrollChange = (direction, changeFn) -> element = activatedElement loop oldScrollValue = element[axisName] - changeFn(element, axisName) + overflow = window.getComputedStyle(element, null).getPropertyValue("overflow-#{direction}") + # Elements with `overflow: hidden` don't natively have scrolling, so we shouldn't scroll them. + changeFn(element, axisName) unless overflow == "hidden" break unless (element[axisName] == oldScrollValue && element != document.body) lastElement = element # we may have an orphaned element. if so, just scroll the body element. |
