mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update polymer
This commit is contained in:
parent
d2bb0d6805
commit
d96a2b7946
28 changed files with 109 additions and 118 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "iron-iconset-svg",
|
||||
"description": "Manages a set of svg icons",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
|
@ -30,11 +30,11 @@
|
|||
"web-component-tester": "*"
|
||||
},
|
||||
"homepage": "https://github.com/polymerelements/iron-iconset-svg",
|
||||
"_release": "1.0.5",
|
||||
"_release": "1.0.6",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.5",
|
||||
"commit": "54d35698c1e06462452997f8731ea31a4bf1638c"
|
||||
"tag": "v1.0.6",
|
||||
"commit": "ebd17924942abe6110aa0fe81b1b31e1fcc34a9f"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-iconset-svg.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "iron-iconset-svg",
|
||||
"description": "Manages a set of svg icons",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
|
|
|
@ -179,13 +179,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;
|
||||
|
|
|
@ -42,6 +42,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<defs>
|
||||
<circle id="circle" cx="20" cy="20" r="10"></circle>
|
||||
<rect id="square" x="0" y="0" width="20" height="20"></rect>
|
||||
<symbol id="rect" viewBox="0 0 50 25">
|
||||
<rect x="0" y="0" width="50" height="25"></rect>
|
||||
</symbol>
|
||||
</defs>
|
||||
</svg>
|
||||
</iron-iconset-svg>
|
||||
|
@ -97,7 +100,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
|
||||
test('can be queried for all available icons', function () {
|
||||
expect(iconset.getIconNames()).to.deep.eql(['my-icons:circle', 'my-icons:square']);
|
||||
expect(iconset.getIconNames()).to.deep.eql(['my-icons:circle', 'my-icons:square', 'my-icons:rect']);
|
||||
});
|
||||
|
||||
test('supports any icon defined in the svg', function () {
|
||||
|
@ -110,6 +113,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
});
|
||||
|
||||
test('prefers a viewBox attribute over the iconset size', function () {
|
||||
iconset.applyIcon(div, 'rect');
|
||||
expect(div.firstElementChild.getAttribute('viewBox')).to.be.equal('0 0 50 25');
|
||||
});
|
||||
|
||||
test('uses the iconset size when viewBox is not defined on the element', function () {
|
||||
iconset.applyIcon(div, 'circle');
|
||||
expect(div.firstElementChild.getAttribute('viewBox')).to.be.equal('0 0 20 20');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue