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

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

Issue 110723007: Add the viewer toolbar to the PDF extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 12 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <polymer-element name="viewer-button" attributes="src latchable">
2 <template>
3 <link rel="stylesheet" href="viewer-button.css">
4 <div id="icon"></div>
5 </template>
6 <script>
7 (function() {
8 var dpi = '';
9
10 Polymer('viewer-button', {
11 src: '',
12 latchable: false,
13 srcChanged: function() {
14 if (this.src) {
15 if (!dpi) {
16 var mql = window.matchMedia('(-webkit-min-device-pixel-ratio: 1.3');
17 dpi = mql.matches ? 'hi' : 'low';
18 }
ganetsky1 2014/01/03 18:14:39 You may want to consider moving this out to ready:
raymes 2014/01/06 00:22:45 Done.
19 this.$.icon.style.backgroundImage =
20 'url(elements/viewer-button/img/' + dpi + 'DPI/' + this.src + ')';
21 } else {
22 this.$.icon.style.backgroundImage = '';
23 }
24 },
25 latchableChanged: function() {
26 if (this.latchable)
27 this.classList.add('latchable')
28 else
29 this.classList.remove('latchable')
ganetsky1 2014/01/03 18:14:39 Semicolon? Also, maybe you want to use { } around
raymes 2014/01/06 00:22:45 Added the semicolons. The braces aren't required f
30 },
31 });
32 })();
33 </script>
34 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698