mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update form
This commit is contained in:
parent
077f440dcc
commit
14519607f4
29 changed files with 306 additions and 188 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-overlay-behavior",
|
||||
"version": "1.6.2",
|
||||
"version": "1.6.3",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for making an element an overlay",
|
||||
"private": true,
|
||||
|
@ -35,11 +35,11 @@
|
|||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/polymerelements/iron-overlay-behavior",
|
||||
"_release": "1.6.2",
|
||||
"_release": "1.6.3",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.6.2",
|
||||
"commit": "be4e703b6894af6d4013a8a9f514a384ee91e2db"
|
||||
"tag": "v1.6.3",
|
||||
"commit": "5b331ebaefe3214937b94ba19769154efee46244"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-overlay-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
sudo: required
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
|
@ -8,18 +8,16 @@ env:
|
|||
global:
|
||||
- secure: H8AA9JkWfG/vc3MiimoIoYi45KD10hKzitLJnExkomgzFI/f5o9SGtwjCii5P8Kvf4xndftDjYwRgbYyJpSg0IJeq8rm1WS89cY8O6/1dlI/tK1j5xbVRrhqmRQncxUb3K4MAT6Z9br1jwEeamRa+NKmq+v+VEpQY5vwuQ/BHJw=
|
||||
- secure: EaE1AUVgWyn0Y6kqkb54z5r39RvTJzAOmeM0lRl7wXzr5k0mq3VGlxTksJqCVd1PdJESXEhy8eldBnlkwZir/imDTNQxKm13k7ZiFC0000XAzpLZElkH2cLlYCRWcuM+vS7dA9hytV0UcGK2VGqbxfpcesB20dPSneDEUuc5X64=
|
||||
- CXX=g++-4.8
|
||||
node_js: stable
|
||||
addons:
|
||||
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"
|
||||
dist: trusty
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-overlay-behavior",
|
||||
"version": "1.6.2",
|
||||
"version": "1.6.3",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for making an element an overlay",
|
||||
"private": true,
|
||||
|
|
|
@ -35,8 +35,8 @@ Custom property | Description | Default
|
|||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: var(--iron-overlay-backdrop-background-color, #000);
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s;
|
||||
|
|
|
@ -326,13 +326,13 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
|
||||
// requestAnimationFrame for non-blocking rendering
|
||||
if (this.__openChangedAsync) {
|
||||
cancelAnimationFrame(this.__openChangedAsync);
|
||||
window.cancelAnimationFrame(this.__openChangedAsync);
|
||||
}
|
||||
if (this.opened) {
|
||||
if (this.withBackdrop) {
|
||||
this.backdropElement.prepare();
|
||||
}
|
||||
this.__openChangedAsync = requestAnimationFrame(function() {
|
||||
this.__openChangedAsync = window.requestAnimationFrame(function() {
|
||||
this.__openChangedAsync = null;
|
||||
this._prepareRenderOpened();
|
||||
this._renderOpened();
|
||||
|
@ -543,11 +543,11 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
*/
|
||||
_onIronResize: function() {
|
||||
if (this.__onIronResizeAsync) {
|
||||
cancelAnimationFrame(this.__onIronResizeAsync);
|
||||
window.cancelAnimationFrame(this.__onIronResizeAsync);
|
||||
this.__onIronResizeAsync = null;
|
||||
}
|
||||
if (this.opened && !this.__isAnimating) {
|
||||
this.__onIronResizeAsync = requestAnimationFrame(function() {
|
||||
this.__onIronResizeAsync = window.requestAnimationFrame(function() {
|
||||
this.__onIronResizeAsync = null;
|
||||
this.refit();
|
||||
}.bind(this));
|
||||
|
|
|
@ -52,7 +52,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
/**
|
||||
* The shared backdrop element.
|
||||
* @type {Element} backdropElement
|
||||
* @type {!Element} backdropElement
|
||||
*/
|
||||
get backdropElement() {
|
||||
if (!this._backdropElement) {
|
||||
|
@ -63,7 +63,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
/**
|
||||
* The deepest active element.
|
||||
* @type {Element} activeElement the active element
|
||||
* @type {!Element} activeElement the active element
|
||||
*/
|
||||
get deepActiveElement() {
|
||||
// document.activeElement can be null
|
||||
|
@ -83,13 +83,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
*/
|
||||
_bringOverlayAtIndexToFront: function(i) {
|
||||
var overlay = this._overlays[i];
|
||||
if (!overlay) {
|
||||
return;
|
||||
}
|
||||
var lastI = this._overlays.length - 1;
|
||||
var currentOverlay = this._overlays[lastI];
|
||||
// Ensure always-on-top overlay stays on top.
|
||||
if (!overlay.alwaysOnTop && this._overlays[lastI].alwaysOnTop) {
|
||||
if (currentOverlay && this._shouldBeBehindOverlay(overlay, currentOverlay)) {
|
||||
lastI--;
|
||||
}
|
||||
// If already the top element, return.
|
||||
if (!overlay || i >= lastI) {
|
||||
if (i >= lastI) {
|
||||
return;
|
||||
}
|
||||
// Update z-index to be on top.
|
||||
|
@ -109,7 +113,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
/**
|
||||
* Adds the overlay and updates its z-index if it's opened, or removes it if it's closed.
|
||||
* Also updates the backdrop z-index.
|
||||
* @param {Element} overlay
|
||||
* @param {!Element} overlay
|
||||
*/
|
||||
addOrRemoveOverlay: function(overlay) {
|
||||
if (overlay.opened) {
|
||||
|
@ -123,7 +127,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
/**
|
||||
* Tracks overlays for z-index and focus management.
|
||||
* Ensures the last added overlay with always-on-top remains on top.
|
||||
* @param {Element} overlay
|
||||
* @param {!Element} overlay
|
||||
*/
|
||||
addOverlay: function(overlay) {
|
||||
var i = this._overlays.indexOf(overlay);
|
||||
|
@ -137,7 +141,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
var newZ = this._getZ(overlay);
|
||||
|
||||
// Ensure always-on-top overlay stays on top.
|
||||
if (currentOverlay && currentOverlay.alwaysOnTop && !overlay.alwaysOnTop) {
|
||||
if (currentOverlay && this._shouldBeBehindOverlay(overlay, currentOverlay)) {
|
||||
// This bumps the z-index of +2.
|
||||
this._applyOverlayZ(currentOverlay, minimumZ);
|
||||
insertionIndex--;
|
||||
|
@ -158,7 +162,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
},
|
||||
|
||||
/**
|
||||
* @param {Element} overlay
|
||||
* @param {!Element} overlay
|
||||
*/
|
||||
removeOverlay: function(overlay) {
|
||||
var i = this._overlays.indexOf(overlay);
|
||||
|
@ -276,7 +280,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
},
|
||||
|
||||
/**
|
||||
* @param {Element} element
|
||||
* @param {!Element} element
|
||||
* @param {number|string} z
|
||||
* @private
|
||||
*/
|
||||
|
@ -285,7 +289,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
},
|
||||
|
||||
/**
|
||||
* @param {Element} overlay
|
||||
* @param {!Element} overlay
|
||||
* @param {number} aboveZ
|
||||
* @private
|
||||
*/
|
||||
|
@ -365,6 +369,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
overlay._onCaptureTab(event);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns if the overlay1 should be behind overlay2.
|
||||
* @param {!Element} overlay1
|
||||
* @param {!Element} overlay2
|
||||
* @return {boolean}
|
||||
* @private
|
||||
*/
|
||||
_shouldBeBehindOverlay: function(overlay1, overlay2) {
|
||||
var o1 = /** @type {?} */ (overlay1);
|
||||
var o2 = /** @type {?} */ (overlay2);
|
||||
return !o1.alwaysOnTop && o2.alwaysOnTop;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -22,10 +22,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<script>
|
||||
WCT.loadSuites([
|
||||
'iron-overlay-behavior.html',
|
||||
'iron-overlay-behavior.html?dom=shadow'
|
||||
'iron-overlay-behavior.html?dom=shadow',
|
||||
'iron-overlay-backdrop.html',
|
||||
'iron-overlay-backdrop.html?dom=shadow',
|
||||
]);
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
|
|
94
dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-backdrop.html
vendored
Normal file
94
dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-backdrop.html
vendored
Normal file
|
@ -0,0 +1,94 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2016 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
|
||||
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>
|
||||
|
||||
<title>iron-overlay-backdrop tests</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<link rel="import" href="../../iron-test-helpers/iron-test-helpers.html">
|
||||
<link rel="import" href="test-overlay.html">
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
.sizer {
|
||||
width: 4000px;
|
||||
height: 5000px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style is="custom-style">
|
||||
iron-overlay-backdrop {
|
||||
/* For quicker tests */
|
||||
--iron-overlay-backdrop: {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="sizer"></div>
|
||||
|
||||
<test-fixture id="backdrop">
|
||||
<template>
|
||||
<test-overlay with-backdrop>
|
||||
Overlay with backdrop
|
||||
</test-overlay>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
function runAfterOpen(overlay, callback) {
|
||||
overlay.addEventListener('iron-overlay-opened', callback);
|
||||
overlay.open();
|
||||
}
|
||||
|
||||
suite('overlay with backdrop', function() {
|
||||
var overlay;
|
||||
|
||||
setup(function() {
|
||||
overlay = fixture('backdrop');
|
||||
});
|
||||
|
||||
test('backdrop size matches parent size', function(done) {
|
||||
runAfterOpen(overlay, function() {
|
||||
Polymer.Base.async(function() {
|
||||
var backdrop = overlay.backdropElement;
|
||||
var parent = backdrop.parentElement;
|
||||
assert.strictEqual(backdrop.offsetWidth, parent.clientWidth, 'backdrop width matches parent width');
|
||||
assert.strictEqual(backdrop.offsetHeight, parent.clientHeight, 'backdrop height matches parent height');
|
||||
done();
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue