/
MediaQueryList.cljs
92 lines (65 loc) · 2.79 KB
/
MediaQueryList.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
(ns web.cssdom.MediaQueryList
"A MediaQueryList object stores information on a media query applied
a document, with support for both immediate and event-driven
against the state of the document."
(:refer-clojure :exclude []))
(defn add-listener
"Method.
The addListener() method of the `web.cssdom.MediaQueryList` interface
a listener to the MediaQueryListener that will run a custom callback
in response to the media query status changing.
`MediaQueryList.addListener(func)`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener`"
[this func]
(-> this (.addListener func)))
(defn remove-listener
"Method.
The removeListener() method of the `web.cssdom.MediaQueryList`
removes a listener from the MediaQueryListener.
`MediaQueryList.removeListener(func)`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/removeListener`"
[this func]
(-> this (.removeListener func)))
(defn matches
"Property.
[Read Only]
The matches read-only property of the `web.cssdom.MediaQueryList`
is a `js.Boolean` that returns true if the `document` currently
the media query list, or false if not.
`var matches = MediaQueryList.matches;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/matches`"
[this]
(-> this (.-matches)))
(defn media
"Property.
[Read Only]
The media read-only property of the `web.cssdom.MediaQueryList`
is a `web.dom.DOMString` representing a serialized media query.
`var media = MediaQueryList.media;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/media`"
[this]
(-> this (.-media)))
(defn onchange
"Property.
The onchange property of the `web.cssdom.MediaQueryList` interface
an event handler property representing a function that is invoked
the change event fires, i.e when the status of media query support
The event object is a `web.media.MediaQueryListEvent` instance,
is recognised as a MediaListQuery instance in older browsers,
backwards compatibility purposes.
`MediaQueryList.onchange = function() { ... };`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/onchange`"
[this]
(-> this (.-onchange)))
(defn set-onchange!
"Property.
The onchange property of the `web.cssdom.MediaQueryList` interface
an event handler property representing a function that is invoked
the change event fires, i.e when the status of media query support
The event object is a `web.media.MediaQueryListEvent` instance,
is recognised as a MediaListQuery instance in older browsers,
backwards compatibility purposes.
`MediaQueryList.onchange = function() { ... };`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/onchange`"
[this val]
(aset this "onchange" val))