1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update collection menus

This commit is contained in:
Luke Pulverenti 2015-10-07 17:42:29 -04:00
parent 65442321a0
commit 8119b930e4
17 changed files with 183 additions and 52 deletions

View file

@ -1,6 +1,6 @@
{
"name": "iron-selector",
"version": "1.0.6",
"version": "1.0.7",
"description": "Manages a set of elements that can be selected",
"private": true,
"license": "http://polymer.github.io/LICENSE.txt",
@ -32,11 +32,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.0.6",
"_release": "1.0.7",
"_resolution": {
"type": "version",
"tag": "v1.0.6",
"commit": "08fa18c70b79abdee8a02486223ab9a4f0acc72c"
"tag": "v1.0.7",
"commit": "0b2f484ac3b1b03400da2d38b0f543f3688150a4"
},
"_source": "git://github.com/PolymerElements/iron-selector.git",
"_target": "^1.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "iron-selector",
"version": "1.0.6",
"version": "1.0.7",
"description": "Manages a set of elements that can be selected",
"private": true,
"license": "http://polymer.github.io/LICENSE.txt",

View file

@ -128,6 +128,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
created: function() {
this._bindFilterItem = this._filterItem.bind(this);
this._selection = new Polymer.IronSelection(this._applySelection.bind(this));
// TODO(cdata): When polymer/polymer#2535 lands, we do not need to do this
// book keeping anymore:
this.__listeningForActivate = false;
},
attached: function() {
@ -136,6 +139,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
if (!this.selectedItem && this.selected) {
this._updateSelected(this.attrForSelected,this.selected)
}
this._addListener(this.activateEvent);
},
detached: function() {
@ -202,11 +206,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
_addListener: function(eventName) {
if (!this.isAttached || this.__listeningForActivate) {
return;
}
this.__listeningForActivate = true;
this.listen(this, eventName, '_activateHandler');
},
_removeListener: function(eventName) {
this.unlisten(this, eventName, '_activateHandler');
this.__listeningForActivate = false;
},
_activateEventChanged: function(eventName, old) {

View file

@ -130,6 +130,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.equal(s.selected, '0');
});
test('activates after detach and re-attach', function() {
// Detach and re-attach
var parent = s.parentNode;
parent.removeChild(s);
parent.appendChild(s);
// select Item 2
s.children[2].dispatchEvent(new CustomEvent('tap', {bubbles: true}));
assert.equal(s.selected, '2');
});
});
</script>