summaryrefslogtreecommitdiffstats
path: root/client/components/mixins/perfectScrollbar.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/mixins/perfectScrollbar.js')
-rw-r--r--client/components/mixins/perfectScrollbar.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/client/components/mixins/perfectScrollbar.js b/client/components/mixins/perfectScrollbar.js
index f652f043..12f8a892 100644
--- a/client/components/mixins/perfectScrollbar.js
+++ b/client/components/mixins/perfectScrollbar.js
@@ -1,12 +1,16 @@
+const { isTouchDevice } = Utils;
+
Mixins.PerfectScrollbar = BlazeComponent.extendComponent({
onRendered() {
- const component = this.mixinParent();
- const domElement = component.find('.js-perfect-scrollbar');
- Ps.initialize(domElement);
+ if (!isTouchDevice()) {
+ const component = this.mixinParent();
+ const domElement = component.find('.js-perfect-scrollbar');
+ Ps.initialize(domElement);
- // XXX We should create an event map to be consistent with other components
- // but since BlazeComponent doesn't merge Mixins events transparently I
- // prefered to use a jQuery event (which is what an event map ends up doing)
- component.$(domElement).on('mouseenter', () => Ps.update(domElement));
+ // XXX We should create an event map to be consistent with other components
+ // but since BlazeComponent doesn't merge Mixins events transparently I
+ // prefered to use a jQuery event (which is what an event map ends up doing)
+ component.$(domElement).on('mouseenter', () => Ps.update(domElement));
+ }
},
});