From 339baea8762885a85ac755ef51d57ba441bf3e53 Mon Sep 17 00:00:00 2001 From: Micooz Date: Fri, 28 Jul 2017 10:27:42 +0800 Subject: [PATCH] utils: add isMobile --- src/utils.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils.js b/src/utils.js index 3aaa562..c74a47f 100644 --- a/src/utils.js +++ b/src/utils.js @@ -35,4 +35,10 @@ module.exports = { } return actualLeft - elementScrollLeft; }, + + /** + * check if user is using mobile or not + */ + isMobile: /mobile/i.test(window.navigator.userAgent) + };