Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Side by Side Diff: third_party/polymer/v1_0/components-chromium/iron-media-query/iron-media-query-extracted.js

Issue 1162963002: Revert "Rename polymer and cr_elements v0_8 to v1_0" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1
2
3 Polymer({
4
5 is: 'iron-media-query',
6
7 properties: {
8
9 /**
10 * The Boolean return value of the media query.
11 *
12 * @attribute queryMatches
13 * @type Boolean
14 * @default false
15 */
16 queryMatches: {
17 type: Boolean,
18 value: false,
19 readOnly: true,
20 notify: true
21 },
22
23 /**
24 * The CSS media query to evaluate.
25 *
26 * @attribute query
27 * @type String
28 */
29 query: {
30 type: String,
31 observer: 'queryChanged'
32 }
33
34 },
35
36 created: function() {
37 this._mqHandler = this.queryHandler.bind(this);
38 },
39
40 queryChanged: function(query) {
41 if (this._mq) {
42 this._mq.removeListener(this._mqHandler);
43 }
44 if (query[0] !== '(') {
45 query = '(' + query + ')';
46 }
47 this._mq = window.matchMedia(query);
48 this._mq.addListener(this._mqHandler);
49 this.queryHandler(this._mq);
50 },
51
52 queryHandler: function(mq) {
53 this._setQueryMatches(mq.matches);
54 }
55
56 });
57
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698