mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix sync status display
This commit is contained in:
parent
a07e6b59a3
commit
94a5cf7549
26 changed files with 415 additions and 276 deletions
|
@ -27,14 +27,14 @@
|
|||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/polymerelements/iron-behaviors",
|
||||
"homepage": "https://github.com/PolymerElements/iron-behaviors",
|
||||
"_release": "1.0.8",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.8",
|
||||
"commit": "663ad706b43989f4961d945b8116cf4db346532f"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-behaviors.git",
|
||||
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/iron-behaviors"
|
||||
"_originalSource": "PolymerElements/iron-behaviors"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-overlay-behavior",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for making an element an overlay",
|
||||
"private": true,
|
||||
|
@ -35,11 +35,11 @@
|
|||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/polymerelements/iron-overlay-behavior",
|
||||
"_release": "1.0.8",
|
||||
"_release": "1.0.9",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.8",
|
||||
"commit": "cf25fe1ff2f585fa84190537bf62b94eb1579aad"
|
||||
"tag": "v1.0.9",
|
||||
"commit": "87f7763d323fffa07357a08777ad831b7c2c2fb8"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-overlay-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-overlay-behavior",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for making an element an overlay",
|
||||
"private": true,
|
||||
|
|
|
@ -28,7 +28,8 @@ intent. Closing generally implies that the user acknowledged the content on the
|
|||
it will cancel whenever the user taps outside it or presses the escape key. This behavior is
|
||||
configurable with the `no-cancel-on-esc-key` and the `no-cancel-on-outside-click` properties.
|
||||
`close()` should be called explicitly by the implementer when the user interacts with a control
|
||||
in the overlay element.
|
||||
in the overlay element. When the dialog is canceled, the overlay fires an 'iron-overlay-canceled'
|
||||
event. Call `preventDefault` on this event to prevent the overlay from closing.
|
||||
|
||||
### Positioning
|
||||
|
||||
|
@ -199,6 +200,11 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
* Cancels the overlay.
|
||||
*/
|
||||
cancel: function() {
|
||||
var cancelEvent = this.fire('iron-overlay-canceled', undefined, {cancelable: true});
|
||||
if (cancelEvent.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.opened = false;
|
||||
this._setCanceled(true);
|
||||
},
|
||||
|
|
|
@ -180,6 +180,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
|
||||
test('cancel an overlay by clicking outside', function(done) {
|
||||
runAfterOpen(overlay, function() {
|
||||
overlay.addEventListener('iron-overlay-canceled', function(event) {
|
||||
done();
|
||||
});
|
||||
Polymer.Base.fire.call(document, 'click');
|
||||
});
|
||||
});
|
||||
|
||||
test('close an overlay by clicking outside', function(done) {
|
||||
runAfterOpen(overlay, function() {
|
||||
overlay.addEventListener('iron-overlay-closed', function(event) {
|
||||
assert.isTrue(event.detail.canceled, 'overlay is canceled');
|
||||
|
@ -189,7 +198,35 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
});
|
||||
|
||||
test('cancel event can be prevented', function(done) {
|
||||
runAfterOpen(overlay, function() {
|
||||
overlay.addEventListener('iron-overlay-canceled', function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
var closedListener = function(event) {
|
||||
throw new Error('iron-overlay-closed should not fire');
|
||||
};
|
||||
overlay.addEventListener('iron-overlay-closed', closedListener);
|
||||
Polymer.Base.fire.call(document, 'click');
|
||||
setTimeout(function() {
|
||||
overlay.removeEventListener('iron-overlay-closed', closedListener);
|
||||
done();
|
||||
}, 10);
|
||||
});
|
||||
});
|
||||
|
||||
test('cancel an overlay with esc key', function(done) {
|
||||
runAfterOpen(overlay, function() {
|
||||
overlay.addEventListener('iron-overlay-canceled', function(event) {
|
||||
done();
|
||||
});
|
||||
fireEvent('keydown', {
|
||||
keyCode: 27
|
||||
}, document);
|
||||
});
|
||||
});
|
||||
|
||||
test('close an overlay with esc key', function(done) {
|
||||
runAfterOpen(overlay, function() {
|
||||
overlay.addEventListener('iron-overlay-closed', function(event) {
|
||||
assert.isTrue(event.detail.canceled, 'overlay is canceled');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue