From 9573d7f11d13f7a4acc8b50803f6af00c3fc3323 Mon Sep 17 00:00:00 2001 From: Steve Orvell Date: Tue, 15 Jul 2014 14:55:08 -0700 Subject: [PATCH] sizing of icon now assumed to be via css. --- core-iconset-svg.html | 17 ++++----- demo.html | 88 +++++++++++-------------------------------- svg-sample-icons.html | 1 + 3 files changed, 31 insertions(+), 75 deletions(-) diff --git a/core-iconset-svg.html b/core-iconset-svg.html index e39e680..700696d 100644 --- a/core-iconset-svg.html +++ b/core-iconset-svg.html @@ -116,9 +116,10 @@ * @param {Element} element The element to which the icon is * applied. * @param {String|Number} icon The name the icon to apply. + * @return {Element} The icon element */ - applyIcon: function(element, icon, scale) { - var root = element.shadowRoot || element; + applyIcon: function(element, icon) { + var root = element; // remove old var old = root.querySelector('svg'); if (old) { @@ -129,16 +130,12 @@ if (!svg) { return; } - var size = scale * this.iconSize; - if (size) { - svg.style.height = svg.style.width = size + 'px'; - } else { - svg.setAttribute('height', '100%'); - svg.setAttribute('width', '100%'); - svg.setAttribute('preserveAspectRatio', 'xMidYMid meet'); - } + svg.setAttribute('height', '100%'); + svg.setAttribute('width', '100%'); + svg.setAttribute('preserveAspectRatio', 'xMidYMid meet'); svg.style.display = 'block'; root.insertBefore(svg, root.firstElementChild); + return svg; }, /** diff --git a/demo.html b/demo.html index 8c7b13b..5995cd6 100644 --- a/demo.html +++ b/demo.html @@ -15,25 +15,30 @@ - - - - - - - - -
- -
- + diff --git a/svg-sample-icons.html b/svg-sample-icons.html index b0f2bdf..9f5ef3d 100644 --- a/svg-sample-icons.html +++ b/svg-sample-icons.html @@ -8,6 +8,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt --> +