diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-09-03 18:14:43 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-09-03 18:14:43 +0200 |
| commit | 0261ee59c47c4a940cd41b526bd891a97c02a6dd (patch) | |
| tree | f67ee85390c75801de2312b94a624b13326dbae9 /StoneIsland/www/js/lib/etc/scroll.js | |
| parent | 6f2af841c17ff4ed28d40121114825a40e8cf6fa (diff) | |
ditching iscroll
Diffstat (limited to 'StoneIsland/www/js/lib/etc/scroll.js')
| -rw-r--r-- | StoneIsland/www/js/lib/etc/scroll.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/StoneIsland/www/js/lib/etc/scroll.js b/StoneIsland/www/js/lib/etc/scroll.js new file mode 100644 index 00000000..253921e1 --- /dev/null +++ b/StoneIsland/www/js/lib/etc/scroll.js @@ -0,0 +1,29 @@ +// stub for native scroller when in voiceover mode +function NativeScroll(el) { + var Scroller = { + x: 0, + y: 0, + $el: $(el), + } + + Scroller.refresh = function(){} + Scroller.on = function(){} + Scroller.off = function(){} + + Scroller.scrollTo = function(x, y) { + Scroller.$el.scrollTop(y) + } + Scroller.scrollToElement = function(selector) { + var y = $(selector).offset().top + Scroller.$el.scrollTop(y) + } + + return Scroller +} + +function ScrollFactory (el, opt) { + if (accessibility.voiceOver) { + return NativeScroll(el) + } + return new IScroll(el, opt) +} |
