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
59c19c458f
commit
0f44fb37b3
13 changed files with 97 additions and 118 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-dialog-behavior",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "Implements a behavior used for material design dialogs",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
|
@ -34,11 +34,11 @@
|
|||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.2.0",
|
||||
"_release": "1.2.1",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.2.0",
|
||||
"commit": "a3be07d2784073d5e9e5175fb7d13f7b1f2a5558"
|
||||
"tag": "v1.2.1",
|
||||
"commit": "6fd7f85f04ca833d35fd991ba08270ce92057594"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/paper-dialog-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
33
dashboard-ui/bower_components/paper-dialog-behavior/.github/ISSUE_TEMPLATE.md
vendored
Normal file
33
dashboard-ui/bower_components/paper-dialog-behavior/.github/ISSUE_TEMPLATE.md
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
<!-- Instructions: https://github.com/PolymerElements/paper-dialog-behavior/CONTRIBUTING.md#filing-issues -->
|
||||
### Description
|
||||
<!-- Example: The `paper-foo` element causes the page to turn pink when clicked. -->
|
||||
|
||||
### Expected outcome
|
||||
|
||||
<!-- Example: The page stays the same color. -->
|
||||
|
||||
### Actual outcome
|
||||
|
||||
<!-- Example: The page turns pink. -->
|
||||
|
||||
### Live Demo
|
||||
<!-- Example: https://jsbin.com/cagaye/edit?html,output -->
|
||||
|
||||
### Steps to reproduce
|
||||
|
||||
<!-- Example
|
||||
1. Put a `paper-foo` element in the page.
|
||||
2. Open the page in a web browser.
|
||||
3. Click the `paper-foo` element.
|
||||
-->
|
||||
|
||||
### Browsers Affected
|
||||
<!-- Check all that apply -->
|
||||
- [ ] Chrome
|
||||
- [ ] Firefox
|
||||
- [ ] Safari 9
|
||||
- [ ] Safari 8
|
||||
- [ ] Safari 7
|
||||
- [ ] Edge
|
||||
- [ ] IE 11
|
||||
- [ ] IE 10
|
|
@ -21,6 +21,5 @@ addons:
|
|||
- g++-4.8
|
||||
sauce_connect: true
|
||||
script:
|
||||
- xvfb-run wct -l chrome
|
||||
- xvfb-run wct -l firefox
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-dialog-behavior",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "Implements a behavior used for material design dialogs",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
|
|
|
@ -60,8 +60,6 @@ to override this attribute with `role="alertdialog"`.
|
|||
If `modal` is set, the element will set `aria-modal` and prevent the focus from exiting the element.
|
||||
It will also ensure that focus remains in the dialog.
|
||||
|
||||
The `aria-labelledby` attribute will be set to the header element, if one exists.
|
||||
|
||||
@hero hero.svg
|
||||
@demo demo/index.html
|
||||
@polymerBehavior Polymer.PaperDialogBehavior
|
||||
|
@ -101,16 +99,6 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
|
|||
this.__prevWithBackdrop = this.withBackdrop;
|
||||
},
|
||||
|
||||
attached: function() {
|
||||
// this._observer is used by iron-overlay-behavior
|
||||
this._ariaObserver = Polymer.dom(this).observeNodes(this._updateAriaLabelledBy);
|
||||
this._updateAriaLabelledBy();
|
||||
},
|
||||
|
||||
detached: function() {
|
||||
Polymer.dom(this).unobserveNodes(this._ariaObserver);
|
||||
},
|
||||
|
||||
_modalChanged: function(modal, readied) {
|
||||
if (modal) {
|
||||
this.setAttribute('aria-modal', 'true');
|
||||
|
@ -142,27 +130,6 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
|
|||
}
|
||||
},
|
||||
|
||||
_updateAriaLabelledBy: function() {
|
||||
var header = Polymer.dom(this).querySelector('h2');
|
||||
if (!header) {
|
||||
this.removeAttribute('aria-labelledby');
|
||||
return;
|
||||
}
|
||||
var headerId = header.getAttribute('id');
|
||||
if (headerId && this.getAttribute('aria-labelledby') === headerId) {
|
||||
return;
|
||||
}
|
||||
// set aria-describedBy to the header element
|
||||
var labelledById;
|
||||
if (headerId) {
|
||||
labelledById = headerId;
|
||||
} else {
|
||||
labelledById = 'paper-dialog-header-' + new Date().getUTCMilliseconds();
|
||||
header.setAttribute('id', labelledById);
|
||||
}
|
||||
this.setAttribute('aria-labelledby', labelledById);
|
||||
},
|
||||
|
||||
_updateClosingReasonConfirmed: function(confirmed) {
|
||||
this.closingReason = this.closingReason || {};
|
||||
this.closingReason.confirmed = confirmed;
|
||||
|
|
|
@ -143,16 +143,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<script>
|
||||
|
||||
// Firefox 43 and later will keep the focus on the search bar, so we need
|
||||
// to move the focus on the document for focus-related tests.
|
||||
function ensureDocumentHasFocus() {
|
||||
window.top && window.top.focus();
|
||||
}
|
||||
|
||||
function runAfterOpen(dialog, cb) {
|
||||
dialog.addEventListener('iron-overlay-opened', function() {
|
||||
cb();
|
||||
});
|
||||
function runAfterOpen(dialog, callback) {
|
||||
dialog.addEventListener('iron-overlay-opened', callback);
|
||||
dialog.open();
|
||||
}
|
||||
|
||||
|
@ -333,45 +325,39 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
|
||||
test('multiple modal dialogs opened, handle focus change', function(done) {
|
||||
ensureDocumentHasFocus();
|
||||
|
||||
var dialogs = fixture('multiple');
|
||||
var focusChange = sinon.stub();
|
||||
document.body.addEventListener('focus', focusChange, true);
|
||||
|
||||
runAfterOpen(dialogs[0], function() {
|
||||
// Wait 10ms to allow focus changes
|
||||
dialogs[1].async(dialogs[1].open, 10);
|
||||
dialogs[1].addEventListener('iron-overlay-opened', function() {
|
||||
// Wait 10ms to allow focus changes
|
||||
setTimeout(function() {
|
||||
runAfterOpen(dialogs[1], function() {
|
||||
// Each modal dialog will trap the focus within its children.
|
||||
// Multiple modal dialogs doing it might result in an infinite loop
|
||||
// dialog1 focus -> dialog2 focus -> dialog1 focus -> dialog2 focus...
|
||||
// causing a "Maximum call stack size exceeded" error.
|
||||
// Wait 50ms and verify this does not happen.
|
||||
Polymer.Base.async(function() {
|
||||
// Should not enter in an infinite loop.
|
||||
assert.equal(focusChange.callCount, 2, 'focus change count');
|
||||
done();
|
||||
}, 10);
|
||||
}, 50);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('multiple modal dialogs opened, handle backdrop click', function(done) {
|
||||
ensureDocumentHasFocus();
|
||||
|
||||
test('multiple modal dialogs opened, handle outside click', function(done) {
|
||||
var dialogs = fixture('multiple');
|
||||
var focusChange = sinon.stub();
|
||||
document.body.addEventListener('focus', focusChange, true);
|
||||
|
||||
runAfterOpen(dialogs[0], function() {
|
||||
// Wait 10ms to allow focus changes
|
||||
dialogs[1].async(dialogs[1].open, 10);
|
||||
dialogs[1].addEventListener('iron-overlay-opened', function() {
|
||||
// This will trigger click listener for both dialogs.
|
||||
runAfterOpen(dialogs[1], function() {
|
||||
// Click should be handled only by dialogs[1].
|
||||
MockInteractions.tap(document.body);
|
||||
// Wait 10ms to allow focus changes
|
||||
setTimeout(function() {
|
||||
// Each modal dialog will trap the focus within its children.
|
||||
// Multiple modal dialogs doing it might result in an infinite loop
|
||||
// dialog1 focus -> dialog2 focus -> dialog1 focus -> dialog2 focus...
|
||||
// causing a "Maximum call stack size exceeded" error.
|
||||
// Wait 50ms and verify this does not happen.
|
||||
Polymer.Base.async(function() {
|
||||
// Should not enter in an infinite loop.
|
||||
assert.equal(focusChange.callCount, 2, 'focus change count');
|
||||
done();
|
||||
}, 10);
|
||||
}, 50);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -424,32 +410,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.equal(dialog.getAttribute('aria-modal'), 'true', 'has aria-modal="true"');
|
||||
});
|
||||
|
||||
test('dialog with header has aria-labelledby', function() {
|
||||
var dialog = fixture('header');
|
||||
var header = Polymer.dom(dialog).querySelector('h2');
|
||||
assert.ok(header.getAttribute('id'), 'header has auto-generated id');
|
||||
assert.equal(dialog.getAttribute('aria-labelledby'), header.getAttribute('id'), 'aria-labelledby is set to header id');
|
||||
});
|
||||
|
||||
test('dialog with lazily created header has aria-labelledby', function(done) {
|
||||
var dialog = fixture('basic');
|
||||
var header = document.createElement('h2');
|
||||
Polymer.dom(dialog).appendChild(header);
|
||||
Polymer.dom.flush();
|
||||
setTimeout(function() {
|
||||
assert.ok(header.getAttribute('id'), 'header has auto-generated id');
|
||||
assert.equal(dialog.getAttribute('aria-labelledby'), header.getAttribute('id'), 'aria-labelledby is set to header id');
|
||||
done();
|
||||
}, 10);
|
||||
});
|
||||
|
||||
test('dialog with header with id preserves id and has aria-labelledby', function() {
|
||||
var dialog = fixture('header-with-id');
|
||||
var header = Polymer.dom(dialog).querySelector('h2');
|
||||
assert.equal(header.getAttribute('id'), 'header', 'header has preset id');
|
||||
assert.equal(dialog.getAttribute('aria-labelledby'), 'header', 'aria-labelledby is set to header id');
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue