Browse Source

utils: add isMobile

Micooz 8 years ago
parent
commit
339baea876
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/utils.js

+ 6 - 0
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)
+
 };