mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
669a2e46d4
commit
3c9e6e0374
10 changed files with 109 additions and 50 deletions
|
@ -30,14 +30,14 @@
|
|||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior",
|
||||
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
|
||||
"_release": "1.1.1",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.1.1",
|
||||
"commit": "12af7cb19b2c6b3887e37a5ea1501ffe676d1e8a"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git",
|
||||
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/iron-a11y-keys-behavior"
|
||||
"_originalSource": "PolymerElements/iron-a11y-keys-behavior"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-fit-behavior",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Fits an element inside another element",
|
||||
"private": true,
|
||||
|
@ -24,16 +24,16 @@
|
|||
"paper-styles": "polymerelements/paper-styles#^1.0.2",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "polymer/web-component-tester#^3.4.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/PolymerElements/iron-fit-behavior",
|
||||
"_release": "1.0.5",
|
||||
"_release": "1.0.6",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.5",
|
||||
"commit": "18dec1eb5c7217be4d360c0fb9101fe899136f92"
|
||||
"tag": "v1.0.6",
|
||||
"commit": "f2e868af4fad643ffb7fea3501e1429acc4ec0f0"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-fit-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,22 +1,25 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
before_script:
|
||||
- npm install web-component-tester
|
||||
- npm install bower
|
||||
- 'export PATH=$PWD/node_modules/.bin:$PATH'
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
env:
|
||||
global:
|
||||
- secure: QL2j7nfSA/40iIPMKLMosv9hj8q7eGBbPQXVQmCL3uXD5qoMPTqo1qronKKX+bi3Rh7W104ufV4CzzbWvBwQh8gipx+4REGijzc77Fro2y3v3/wUp9H/UEWnbhAWPDsqEoAD8xQXFHkVv7874/VwOlubQyXDGlvqh0fzYbUNUQo=
|
||||
- secure: ajBo8YcSzi4kNuCHcmajCirWQKf5Mj4OZ3tQjNAcJJAy0UtyrAgTenayWN2ijKqD5V8wfTK66jUXGYMZkoJV4EpknrUliqRgRqKHHfULXYWRSC7lDGxf835ReFxstkPun4HmNtxraAWJgmgFz7mylntTVKm46Ce4INj3n8reWaY=
|
||||
node_js: 4
|
||||
- CXX=g++-4.8
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: '42.0'
|
||||
firefox: latest
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
- g++-4.8
|
||||
sauce_connect: true
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||
|
|
|
@ -5,6 +5,11 @@ https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
|||
|
||||
If you edit that file, it will get updated everywhere else.
|
||||
If you edit this file, your changes will get overridden :)
|
||||
|
||||
You can however override the jsbin link with one that's customized to this
|
||||
specific element:
|
||||
|
||||
jsbin=https://jsbin.com/cagaye/edit?html,output
|
||||
-->
|
||||
# Polymer Elements
|
||||
## Guide for Contributors
|
||||
|
@ -41,7 +46,7 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
|
|||
3. Click the `paper-foo` element.
|
||||
```
|
||||
|
||||
2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [http://jsbin.com/cagaye](http://jsbin.com/cagaye/edit?html,output).
|
||||
2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output).
|
||||
|
||||
3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
|
||||
|
||||
|
@ -51,14 +56,14 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
|
|||
|
||||
When submitting pull requests, please provide:
|
||||
|
||||
1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax:
|
||||
1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax:
|
||||
|
||||
```markdown
|
||||
(For a single issue)
|
||||
Fixes #20
|
||||
|
||||
(For multiple issues)
|
||||
Fixes #32, #40
|
||||
Fixes #32, fixes #40
|
||||
```
|
||||
|
||||
2. **A succinct description of the design** used to fix any related issues. For example:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-fit-behavior",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Fits an element inside another element",
|
||||
"private": true,
|
||||
|
@ -24,7 +24,7 @@
|
|||
"paper-styles": "polymerelements/paper-styles#^1.0.2",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "polymer/web-component-tester#^3.4.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": []
|
||||
|
|
|
@ -24,8 +24,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<style>
|
||||
|
||||
.sized {
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
max-width: 50%;
|
||||
max-height: 50%;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -33,8 +34,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</head>
|
||||
<body unresolved>
|
||||
|
||||
<simple-fit auto-fit-on-attach class="sized">
|
||||
centered in window
|
||||
<simple-fit id="myFit" auto-fit-on-attach class="sized" onclick="myFit.refit()">
|
||||
Centered in window.<br><br>
|
||||
Resize the window and click here to refit.
|
||||
</simple-fit>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -171,14 +171,14 @@ CSS properties | Action
|
|||
* the memoized data.
|
||||
*/
|
||||
resetFit: function() {
|
||||
if (!this._fitInfo || !this._fitInfo.sizedBy.height) {
|
||||
this.sizingTarget.style.maxHeight = '';
|
||||
this.style.top = this._fitInfo ? this._fitInfo.inlineStyle.top : '';
|
||||
}
|
||||
if (!this._fitInfo || !this._fitInfo.sizedBy.width) {
|
||||
this.sizingTarget.style.maxWidth = '';
|
||||
this.style.left = this._fitInfo ? this._fitInfo.inlineStyle.left : '';
|
||||
}
|
||||
if (!this._fitInfo || !this._fitInfo.sizedBy.height) {
|
||||
this.sizingTarget.style.maxHeight = '';
|
||||
}
|
||||
this.style.top = this._fitInfo ? this._fitInfo.inlineStyle.top : '';
|
||||
this.style.left = this._fitInfo ? this._fitInfo.inlineStyle.left : '';
|
||||
if (this._fitInfo) {
|
||||
this.style.position = this._fitInfo.positionedBy.css;
|
||||
}
|
||||
|
@ -239,18 +239,30 @@ CSS properties | Action
|
|||
* `position:fixed`.
|
||||
*/
|
||||
center: function() {
|
||||
if (!this._fitInfo.positionedBy.vertically || !this._fitInfo.positionedBy.horizontally) {
|
||||
// need position:fixed to center
|
||||
this.style.position = 'fixed';
|
||||
var positionedBy = this._fitInfo.positionedBy;
|
||||
if (positionedBy.vertically && positionedBy.horizontally) {
|
||||
// Already positioned.
|
||||
return;
|
||||
}
|
||||
if (!this._fitInfo.positionedBy.vertically) {
|
||||
var top = (this._fitHeight - this.offsetHeight) / 2 + this._fitTop;
|
||||
top -= this._fitInfo.margin.top;
|
||||
// Need position:fixed to center
|
||||
this.style.position = 'fixed';
|
||||
// Take into account the offset caused by parents that create stacking
|
||||
// contexts (e.g. with transform: translate3d). Translate to 0,0 and
|
||||
// measure the bounding rect.
|
||||
if (!positionedBy.vertically) {
|
||||
this.style.top = '0px';
|
||||
}
|
||||
if (!positionedBy.horizontally) {
|
||||
this.style.left = '0px';
|
||||
}
|
||||
// It will take in consideration margins and transforms
|
||||
var rect = this.getBoundingClientRect();
|
||||
if (!positionedBy.vertically) {
|
||||
var top = this._fitTop - rect.top + (this._fitHeight - rect.height) / 2;
|
||||
this.style.top = top + 'px';
|
||||
}
|
||||
if (!this._fitInfo.positionedBy.horizontally) {
|
||||
var left = (this._fitWidth - this.offsetWidth) / 2 + this._fitLeft;
|
||||
left -= this._fitInfo.margin.left;
|
||||
if (!positionedBy.horizontally) {
|
||||
var left = this._fitLeft - rect.left + (this._fitWidth - rect.width) / 2;
|
||||
this.style.left = left + 'px';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
<!DOCTYPE html><!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
|
@ -7,9 +6,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
--><html><head>
|
||||
|
||||
<title>iron-fit-behavior tests</title>
|
||||
|
||||
|
@ -23,12 +20,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<body>
|
||||
|
||||
<script>
|
||||
|
||||
WCT.loadSuites([
|
||||
'iron-fit-behavior.html'
|
||||
'iron-fit-behavior.html',
|
||||
'iron-fit-behavior.html?dom=shadow'
|
||||
]);
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
</body></html>
|
||||
|
|
|
@ -46,6 +46,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
height: 200px;
|
||||
}
|
||||
|
||||
.sized-xy {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.positioned-left {
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
|
@ -83,6 +88,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<test-fixture id="absolute">
|
||||
<template>
|
||||
<test-fit auto-fit-on-attach class="absolute">
|
||||
|
@ -107,6 +113,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="with-max-width">
|
||||
<template>
|
||||
<div class="constrain" style="position: fixed; top: 20px; left: 100px; width: 50vw; height: 50vh; border: 1px solid black;">
|
||||
<test-fit auto-fit-on-attach class="with-max-width el">
|
||||
with-max-width, auto center/center
|
||||
</test-fit>
|
||||
</div>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="positioned-xy">
|
||||
<template>
|
||||
<test-fit auto-fit-on-attach class="sized-x positioned-left positioned-top">
|
||||
|
@ -137,7 +153,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<test-fixture id="constrain-target">
|
||||
<template>
|
||||
<div class="constrain" style="position: fixed; top: 20px; left: 100px; width: 50vw; height: 50vh; border: 1px solid black;">
|
||||
<test-fit auto-fit-on-attach class="el">
|
||||
<test-fit auto-fit-on-attach class="el sized-xy">
|
||||
<div>
|
||||
Auto center/center to parent element
|
||||
</div>
|
||||
|
@ -223,6 +239,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.closeTo(rect.top - (window.innerHeight - rect.bottom), 0, 5, 'centered vertically');
|
||||
});
|
||||
|
||||
test('sized element with transformed parent is centered in viewport', function() {
|
||||
var constrain = fixture('constrain-target');
|
||||
var el = Polymer.dom(constrain).querySelector('.el');
|
||||
var rectBefore = el.getBoundingClientRect();
|
||||
constrain.style.transform = 'translate3d(5px, 5px, 0)';
|
||||
el.center();
|
||||
var rectAfter = el.getBoundingClientRect();
|
||||
assert.equal(rectBefore.top, rectAfter.top, 'top ok');
|
||||
assert.equal(rectBefore.bottom, rectAfter.bottom, 'bottom ok');
|
||||
assert.equal(rectBefore.left, rectAfter.left, 'left ok');
|
||||
assert.equal(rectBefore.right, rectAfter.right, 'right ok');
|
||||
});
|
||||
|
||||
test('scrolling element is centered in viewport', function() {
|
||||
var el = fixture('sized-x');
|
||||
makeScrolling(el);
|
||||
|
@ -361,6 +390,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.closeTo(rect.top - crect.top - (crect.bottom - rect.bottom), 0, 5, 'centered vertically in fitInto');
|
||||
});
|
||||
|
||||
test('element with max-width centers in another element', function() {
|
||||
var constrain = fixture('with-max-width');
|
||||
var el = Polymer.dom(constrain).querySelector('.el');
|
||||
el.fitInto = constrain;
|
||||
el.refit();
|
||||
var rect = el.getBoundingClientRect();
|
||||
var crect = constrain.getBoundingClientRect();
|
||||
assert.closeTo(rect.left - crect.left - (crect.right - rect.right), 0, 5, 'centered horizontally in fitInto');
|
||||
assert.closeTo(rect.top - crect.top - (crect.bottom - rect.bottom), 0, 5, 'centered vertically in fitInto');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -31,14 +31,14 @@
|
|||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-icon",
|
||||
"homepage": "https://github.com/polymerelements/iron-icon",
|
||||
"_release": "1.0.7",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.7",
|
||||
"commit": "6f4d152dc3998a6cc12a5a585a654f893dc99381"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-icon.git",
|
||||
"_source": "git://github.com/polymerelements/iron-icon.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/iron-icon"
|
||||
"_originalSource": "polymerelements/iron-icon"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue