From 0261ee59c47c4a940cd41b526bd891a97c02a6dd Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 3 Sep 2019 18:14:43 +0200 Subject: ditching iscroll --- StoneIsland/www/js/lib/etc/scroll.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 StoneIsland/www/js/lib/etc/scroll.js (limited to 'StoneIsland/www/js/lib/etc/scroll.js') 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) +} -- cgit v1.2.3-70-g09d2