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

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 7 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 | 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() {
ganetsky1 2013/12/18 20:05:05 fyi you can use oldValue, newValue as arguments he
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 }
19 this.$.icon.style.backgroundImage =
20 'url(elements/viewer-button/img/' + dpi + 'DPI/' + this.src + ')';
21 }
ganetsky1 2013/12/18 20:05:05 You probably want an else branch which unsets this
raymes 2013/12/18 23:28:54 Done.
22 },
23 latchableChanged: function() {
ganetsky1 2013/12/18 20:05:05 fyi, you can use oldValue, newValue as arguments h
24 if (this.latchable)
25 this.classList.add('latchable')
26 else
27 this.classList.remove('latchable')
28 },
29 });
30 })();
31 </script>
32 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698