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

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

Issue 592593002: Inline scripts were extracted from Polymer elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/echo ""/echo/ Created 6 years, 2 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 Polymer('core-media-query', {
3
4 /**
5 * The Boolean return value of the media query
6 *
7 * @attribute queryMatches
8 * @type Boolean
9 * @default false
10 */
11 queryMatches: false,
12
13 /**
14 * The CSS media query to evaulate
15 *
16 * @attribute query
17 * @type string
18 * @default ''
19 */
20 query: '',
21 ready: function() {
22 this._mqHandler = this.queryHandler.bind(this);
23 this._mq = null;
24 },
25 queryChanged: function() {
26 if (this._mq) {
27 this._mq.removeListener(this._mqHandler);
28 }
29 var query = this.query;
30 if (query[0] !== '(') {
31 query = '(' + this.query + ')';
32 }
33 this._mq = window.matchMedia(query);
34 this._mq.addListener(this._mqHandler);
35 this.queryHandler(this._mq);
36 },
37 queryHandler: function(mq) {
38 this.queryMatches = mq.matches;
39 this.asyncFire('core-media-change', mq);
40 }
41 });
42
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698