MCPcopy Create free account
hub / github.com/apache/cloudstack / deviceEnquire

Function deviceEnquire

ui/src/utils/device.js:26–49  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

24}
25
26export const deviceEnquire = function (callback) {
27 const matchDesktop = {
28 match: () => {
29 callback && callback(DEVICE_TYPE.DESKTOP)
30 }
31 }
32
33 const matchTablet = {
34 match: () => {
35 callback && callback(DEVICE_TYPE.TABLET)
36 }
37 }
38
39 const matchMobile = {
40 match: () => {
41 callback && callback(DEVICE_TYPE.MOBILE)
42 }
43 }
44
45 enquireJs
46 .register('screen and (max-width: 765px)', matchMobile)
47 .register('screen and (min-width: 766px) and (max-width: 1279px)', matchTablet)
48 .register('screen and (min-width: 1280px)', matchDesktop)
49}

Callers 1

mountedFunction · 0.90

Calls 1

registerMethod · 0.65

Tested by

no test coverage detected