File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 44 https://www.ditdot.hr/en
55*/
66
7- // Simple mobile device/tablet detection
8- const isIos = navigator . userAgent . match ( / i p h o n e | i p a d | i p o d / i ) || ( navigator . userAgent . indexOf ( "Mac" ) !== - 1 && "ontouchend" in document )
9- const isMobile = ! ! ( typeof navigator !== 'undefined' && ( isIos || navigator . userAgent . match ( / a n d r o i d / i ) ) )
7+ let
8+ isIos = false ,
9+ isMobile = false
1010
11- // Mixin that adds an `isMobile` data variable
11+ if ( typeof navigator !== 'undefined' && typeof document !== 'undefined' ) {
12+ // Simple mobile device/tablet detection
13+ isIos = navigator . userAgent . match ( / i p h o n e | i p a d | i p o d / i) || ( navigator . userAgent . indexOf ( 'Mac' ) !== - 1 && 'ontouchend' in document )
14+ isMobile = isIos || navigator . userAgent . match ( / a n d r o i d / i)
15+ }
16+
17+ // Mixin that adds `isMobile` and `isIos` data variables
1218export const IsMobile = {
1319 data ( ) {
1420 return {
You can’t perform that action at this time.
0 commit comments