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

Side by Side Diff: chrome/browser/resources/pdf/elements/viewer-button/viewer-button.js

Issue 1521913002: PDF: Delete non-material viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 (function() {
6 var dpi = '';
7
8 Polymer({
9 is: 'viewer-button',
10
11 properties: {
12 img: {
13 type: String,
14 observer: 'imgChanged'
15 },
16
17 latchable: {
18 type: Boolean,
19 observer: 'latchableChanged'
20 }
21 },
22
23 created: function() {
24 if (!dpi) {
25 var mql = window.matchMedia('(-webkit-min-device-pixel-ratio: 1.3');
26 dpi = mql.matches ? 'hi' : 'low';
27 }
28 },
29
30 imgChanged: function() {
31 if (this.img) {
32 this.$.icon.style.backgroundImage =
33 'url(' + this.getAttribute('assetpath') + 'img/' + dpi +
34 'DPI/' + this.img + ')';
35 } else {
36 this.$.icon.style.backgroundImage = '';
37 }
38 },
39
40 latchableChanged: function() {
41 if (this.latchable)
42 this.classList.add('latchable');
43 else
44 this.classList.remove('latchable');
45 },
46 });
47 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698