Index: polymer_1.2.3/bower_components/iron-iconset-svg/iron-iconset-svg.html |
diff --git a/polymer_1.0.4/bower_components/iron-iconset-svg/iron-iconset-svg.html b/polymer_1.2.3/bower_components/iron-iconset-svg/iron-iconset-svg.html |
similarity index 86% |
copy from polymer_1.0.4/bower_components/iron-iconset-svg/iron-iconset-svg.html |
copy to polymer_1.2.3/bower_components/iron-iconset-svg/iron-iconset-svg.html |
index 3cebc2ce1d3283ff6e61dc514cd7699706de4de4..5bd143ad6b63773bef6af7ec64ee4c6085ca092d 100644 |
--- a/polymer_1.0.4/bower_components/iron-iconset-svg/iron-iconset-svg.html |
+++ b/polymer_1.2.3/bower_components/iron-iconset-svg/iron-iconset-svg.html |
@@ -18,9 +18,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
* `iron-iconset-svg` element. Multiple icons should be given distinct id's. |
* |
* Using svg elements to create icons has a few advantages over traditional |
- * bitmap graphics like jpg or png. Icons that use svg are vector based so they |
- * are resolution independent and should look good on any device. They are |
- * stylable via css. Icons can be themed, colorized, and even animated. |
+ * bitmap graphics like jpg or png. Icons that use svg are vector based so |
+ * they are resolution independent and should look good on any device. They |
+ * are stylable via css. Icons can be themed, colorized, and even animated. |
* |
* Example: |
* |
@@ -28,8 +28,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
* <svg> |
* <defs> |
* <g id="shape"> |
- * <rect x="50" y="50" width="50" height="50" /> |
- * <circle cx="50" cy="50" r="50" /> |
+ * <rect x="12" y="0" width="12" height="24" /> |
+ * <circle cx="12" cy="12" r="12" /> |
* </g> |
* </defs> |
* </svg> |
@@ -45,18 +45,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
* |
* @element iron-iconset-svg |
* @demo demo/index.html |
+ * @implements {Polymer.Iconset} |
*/ |
Polymer({ |
- |
is: 'iron-iconset-svg', |
properties: { |
/** |
* The name of the iconset. |
- * |
- * @attribute name |
- * @type string |
*/ |
name: { |
type: String, |
@@ -65,10 +62,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
/** |
* The size of an individual icon. Note that icons must be square. |
- * |
- * @attribute iconSize |
- * @type number |
- * @default 24 |
*/ |
size: { |
type: Number, |
@@ -77,6 +70,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
}, |
+ attached: function() { |
+ this.style.display = 'none'; |
+ }, |
+ |
/** |
* Construct an array of all icon names in this iconset. |
* |
@@ -98,7 +95,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
* @method applyIcon |
* @param {Element} element Element to which the icon is applied. |
* @param {string} iconName Name of the icon to apply. |
- * @return {Element} The svg element which renders the icon. |
+ * @return {?Element} The svg element which renders the icon. |
*/ |
applyIcon: function(element, iconName) { |
// insert svg element into shadow root, if it exists |
@@ -136,6 +133,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
*/ |
_nameChanged: function() { |
new Polymer.IronMeta({type: 'iconset', key: this.name, value: this}); |
+ this.async(function() { |
+ this.fire('iron-iconset-added', this, {node: window}); |
+ }); |
}, |
/** |
@@ -176,13 +176,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
*/ |
_prepareSvgClone: function(sourceSvg, size) { |
if (sourceSvg) { |
- var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); |
- svg.setAttribute('viewBox', ['0', '0', size, size].join(' ')); |
+ var content = sourceSvg.cloneNode(true), |
+ svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'), |
+ viewBox = content.getAttribute('viewBox') || '0 0 ' + size + ' ' + size; |
+ svg.setAttribute('viewBox', viewBox); |
svg.setAttribute('preserveAspectRatio', 'xMidYMid meet'); |
// TODO(dfreedm): `pointer-events: none` works around https://crbug.com/370136 |
// TODO(sjmiles): inline style may not be ideal, but avoids requiring a shadow-root |
svg.style.cssText = 'pointer-events: none; display: block; width: 100%; height: 100%;'; |
- svg.appendChild(sourceSvg.cloneNode(true)).removeAttribute('id'); |
+ svg.appendChild(content).removeAttribute('id'); |
return svg; |
} |
return null; |