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

Unified Diff: elements/viewer-button/viewer-button.html

Issue 213223004: Make all the polymer elements CSP compliant. (Closed) Base URL: https://chromium.googlesource.com/chromium/html-office-public.git@master
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | elements/viewer-button/viewer-button.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: elements/viewer-button/viewer-button.html
diff --git a/elements/viewer-button/viewer-button.html b/elements/viewer-button/viewer-button.html
index 38bf194dacb39bd1d756358610c1c1dea629397b..e1eee7110676434ed3eba4c2fab4f34202e57fb2 100644
--- a/elements/viewer-button/viewer-button.html
+++ b/elements/viewer-button/viewer-button.html
@@ -1,37 +1,7 @@
-<polymer-element name="viewer-button" attributes="src latchable">
+<polymer-element name="viewer-button" attributes="img latchable">
<template>
<link rel="stylesheet" href="viewer-button.css">
<div id="icon"></div>
</template>
-<script>
- (function() {
- var dpi = '';
-
- Polymer('viewer-button', {
- src: '',
- latchable: false,
- ready: function() {
- if (!dpi) {
- var mql = window.matchMedia('(-webkit-min-device-pixel-ratio: 1.3');
- dpi = mql.matches ? 'hi' : 'low';
- }
- },
- srcChanged: function() {
- if (this.src) {
- this.$.icon.style.backgroundImage =
- 'url(' + this.getAttribute('assetpath') + 'img/' + dpi +
- 'DPI/' + this.src + ')';
- } else {
- this.$.icon.style.backgroundImage = '';
- }
- },
- latchableChanged: function() {
- if (this.latchable)
- this.classList.add('latchable');
- else
- this.classList.remove('latchable');
- },
- });
- })();
-</script>
+<script src="viewer-button.js"></script>
</polymer-element>
« no previous file with comments | « no previous file | elements/viewer-button/viewer-button.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698