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

Side by Side Diff: elements/viewer-button/viewer-button.html

Issue 129903002: Add the Quickoffice viewer toolbar polymer elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/html-office-public.git@master
Patch Set: Created 6 years, 11 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
« no previous file with comments | « elements/viewer-button/viewer-button.css ('k') | elements/viewer-toolbar/viewer-toolbar.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ready: function() {
14 if (!dpi) {
15 var mql = window.matchMedia('(-webkit-min-device-pixel-ratio: 1.3');
16 dpi = mql.matches ? 'hi' : 'low';
17 }
18 },
19 srcChanged: function() {
20 if (this.src) {
21 this.$.icon.style.backgroundImage =
22 'url(elements/viewer-button/img/' + dpi + 'DPI/' + this.src + ')';
23 } else {
24 this.$.icon.style.backgroundImage = '';
25 }
26 },
27 latchableChanged: function() {
28 if (this.latchable)
29 this.classList.add('latchable');
30 else
31 this.classList.remove('latchable');
32 },
33 });
34 })();
35 </script>
36 </polymer-element>
OLDNEW
« no previous file with comments | « elements/viewer-button/viewer-button.css ('k') | elements/viewer-toolbar/viewer-toolbar.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698