summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/lib/etc/scroll.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-10-14 15:57:07 +0200
committerJules Laplace <julescarbon@gmail.com>2019-10-14 15:57:07 +0200
commit67da30b4d76f569785da7a1ce86fa822bafddcfa (patch)
treeb605968b276461678120823d25839e04388a3a55 /StoneIsland/platforms/android/assets/www/js/lib/etc/scroll.js
parent9285c7303d8bca4e8b443b002fcbf5cf32c6bafe (diff)
add
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/etc/scroll.js')
-rw-r--r--StoneIsland/platforms/android/assets/www/js/lib/etc/scroll.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/etc/scroll.js b/StoneIsland/platforms/android/assets/www/js/lib/etc/scroll.js
new file mode 100644
index 00000000..253921e1
--- /dev/null
+++ b/StoneIsland/platforms/android/assets/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)
+}