mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update video probing
This commit is contained in:
parent
8a32cc215f
commit
b70aa4926c
25 changed files with 407 additions and 355 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-selector",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"description": "Manages a set of elements that can be selected",
|
||||
"private": true,
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
|
@ -31,11 +31,11 @@
|
|||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.0.3",
|
||||
"_release": "1.0.4",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.3",
|
||||
"commit": "d93b02871f790b6bcb1fff52f24757e9c2eb04a5"
|
||||
"tag": "v1.0.4",
|
||||
"commit": "2af8ee5b7cd489bca7d4689c563b82fd356a9534"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-selector.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-selector",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"description": "Manages a set of elements that can be selected",
|
||||
"private": true,
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
|
|
|
@ -16,34 +16,38 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
Polymer.IronSelectableBehavior = {
|
||||
|
||||
/**
|
||||
* Fired when iron-selector is activated (selected or deselected).
|
||||
* It is fired before the selected items are changed.
|
||||
* Cancel the event to abort selection.
|
||||
* Fired when iron-selector is activated (selected or deselected).
|
||||
* It is fired before the selected items are changed.
|
||||
* Cancel the event to abort selection.
|
||||
*
|
||||
* @event iron-activate
|
||||
*
|
||||
**/
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fired when an item is selected
|
||||
* Fired when an item is selected
|
||||
*
|
||||
* @event iron-select
|
||||
*
|
||||
**/
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fired when an item is deselected
|
||||
* Fired when an item is deselected
|
||||
*
|
||||
* @event iron-deselect
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fired when the list of selectable items changes (e.g., items are
|
||||
* added or removed). The detail of the event is a list of mutation
|
||||
* records that describe what changed.
|
||||
*
|
||||
**/
|
||||
* @event iron-items-changed
|
||||
*/
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
* If you want to use the attribute value of an element for `selected` instead of the index,
|
||||
* set this to the name of the attribute.
|
||||
*
|
||||
* @attribute attrForSelected
|
||||
* @type {string}
|
||||
*/
|
||||
attrForSelected: {
|
||||
type: String,
|
||||
|
@ -52,9 +56,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
/**
|
||||
* Gets or sets the selected element. The default is to use the index of the item.
|
||||
*
|
||||
* @attribute selected
|
||||
* @type {string}
|
||||
*/
|
||||
selected: {
|
||||
type: String,
|
||||
|
@ -63,9 +64,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
/**
|
||||
* Returns the currently selected item.
|
||||
*
|
||||
* @attribute selectedItem
|
||||
* @type {Object}
|
||||
*/
|
||||
selectedItem: {
|
||||
type: Object,
|
||||
|
@ -77,10 +75,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
* The event that fires from items when they are selected. Selectable
|
||||
* will listen for this event from items and update the selection state.
|
||||
* Set to empty string to listen to no events.
|
||||
*
|
||||
* @attribute activateEvent
|
||||
* @type {string}
|
||||
* @default 'tap'
|
||||
*/
|
||||
activateEvent: {
|
||||
type: String,
|
||||
|
@ -91,17 +85,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
/**
|
||||
* This is a CSS selector string. If this is set, only items that match the CSS selector
|
||||
* are selectable.
|
||||
*
|
||||
* @attribute selectable
|
||||
* @type {string}
|
||||
*/
|
||||
selectable: String,
|
||||
|
||||
/**
|
||||
* The class to set on elements when selected.
|
||||
*
|
||||
* @attribute selectedClass
|
||||
* @type {string}
|
||||
*/
|
||||
selectedClass: {
|
||||
type: String,
|
||||
|
@ -110,9 +98,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
/**
|
||||
* The attribute to set on elements when selected.
|
||||
*
|
||||
* @attribute selectedAttribute
|
||||
* @type {string}
|
||||
*/
|
||||
selectedAttribute: {
|
||||
type: String,
|
||||
|
@ -123,10 +108,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
* The set of excluded elements where the key is the `localName`
|
||||
* of the element that will be ignored from the item list.
|
||||
*
|
||||
* @type {object}
|
||||
* @default {template: 1}
|
||||
*/
|
||||
|
||||
excludedLocalNames: {
|
||||
type: Object,
|
||||
value: function() {
|
||||
|
@ -295,7 +278,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
// observe items change under the given node.
|
||||
_observeItems: function(node) {
|
||||
var observer = new MutationObserver(function() {
|
||||
// TODO(cdata): Update this when we get distributed children changed.
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
// Let other interested parties know about the change so that
|
||||
// we don't have to recreate mutation observers everywher.
|
||||
this.fire('iron-items-changed', mutations, {
|
||||
bubbles: false,
|
||||
cancelable: false
|
||||
});
|
||||
|
||||
if (this.selected != null) {
|
||||
this._updateSelected();
|
||||
}
|
||||
|
|
|
@ -142,6 +142,29 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.equal(selectedEventCounter, 0);
|
||||
});
|
||||
|
||||
suite('items changing', function() {
|
||||
test('cause iron-items-changed to fire', function(done) {
|
||||
var newItem = document.createElement('div');
|
||||
var changeCount = 0;
|
||||
|
||||
newItem.id = 'item999';
|
||||
|
||||
s2.addEventListener('iron-items-changed', function() {
|
||||
changeCount++;
|
||||
});
|
||||
|
||||
s2.appendChild(newItem);
|
||||
|
||||
Polymer.Base.async(function() {
|
||||
s2.removeChild(newItem);
|
||||
|
||||
Polymer.Base.async(function() {
|
||||
expect(changeCount).to.be.equal(2);
|
||||
done();
|
||||
}, 1);
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue