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

update components

This commit is contained in:
Luke Pulverenti 2015-08-10 20:14:15 -04:00
parent fa050a3b08
commit f6b3dd3b16
10 changed files with 103 additions and 28 deletions

View file

@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
"version": "1.0.6",
"version": "1.0.7",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [
@ -28,11 +28,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-behaviors",
"_release": "1.0.6",
"_release": "1.0.7",
"_resolution": {
"type": "version",
"tag": "v1.0.6",
"commit": "9dad0f52150c887997045b8bbf2a82b2394b8a37"
"tag": "v1.0.7",
"commit": "033889b20c6b9ebb45a1ff153fbd667e153fe3f7"
},
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
"_target": "^1.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
"version": "1.0.6",
"version": "1.0.7",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [

View file

@ -50,8 +50,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
type: Boolean,
value: false,
notify: true,
reflectToAttribute: true,
observer: '_activeChanged'
reflectToAttribute: true
},
/**
@ -72,6 +71,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
receivedFocusFromKeyboard: {
type: Boolean,
readOnly: true
},
/**
* The aria attribute to be set if the button is a toggle and in the
* active state.
*/
ariaActiveAttribute: {
type: String,
value: 'aria-pressed',
observer: '_ariaActiveAttributeChanged'
}
},
@ -82,7 +91,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
observers: [
'_detectKeyboardFocus(focused)'
'_detectKeyboardFocus(focused)',
'_activeChanged(active, ariaActiveAttribute)'
],
keyBindings: {
@ -180,11 +190,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
this._changedButtonState();
},
_activeChanged: function(active) {
_ariaActiveAttributeChanged: function(value, oldValue) {
if (oldValue && oldValue != value && this.hasAttribute(oldValue)) {
this.removeAttribute(oldValue);
}
},
_activeChanged: function(active, ariaActiveAttribute) {
if (this.toggles) {
this.setAttribute('aria-pressed', active ? 'true' : 'false');
this.setAttribute(this.ariaActiveAttribute,
active ? 'true' : 'false');
} else {
this.removeAttribute('aria-pressed');
this.removeAttribute(this.ariaActiveAttribute);
}
this._changedButtonState();
},

View file

@ -60,6 +60,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
MockInteractions.downAndUp(activeTarget, function() {
try {
expect(activeTarget.hasAttribute('active')).to.be.eql(true);
expect(activeTarget.hasAttribute('aria-pressed')).to.be.eql(true);
expect(activeTarget.getAttribute('aria-pressed')).to.be.eql('true');
done();
} catch (e) {
done(e);
@ -72,6 +74,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
MockInteractions.downAndUp(activeTarget, function() {
try {
expect(activeTarget.hasAttribute('active')).to.be.eql(false);
expect(activeTarget.hasAttribute('aria-pressed')).to.be.eql(true);
expect(activeTarget.getAttribute('aria-pressed')).to.be.eql('false');
done();
} catch (e) {
done(e);
@ -79,6 +83,39 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
});
});
test('the correct aria attribute is set', function(done) {
activeTarget.ariaActiveAttribute = 'aria-checked';
MockInteractions.downAndUp(activeTarget, function() {
try {
expect(activeTarget.hasAttribute('active')).to.be.eql(true);
expect(activeTarget.hasAttribute('aria-checked')).to.be.eql(true);
expect(activeTarget.getAttribute('aria-checked')).to.be.eql('true');
done();
} catch (e) {
done(e);
}
});
});
test('the aria attribute is updated correctly', function(done) {
activeTarget.ariaActiveAttribute = 'aria-checked';
MockInteractions.downAndUp(activeTarget, function() {
try {
expect(activeTarget.hasAttribute('active')).to.be.eql(true);
expect(activeTarget.hasAttribute('aria-checked')).to.be.eql(true);
expect(activeTarget.getAttribute('aria-checked')).to.be.eql('true');
activeTarget.ariaActiveAttribute = 'aria-pressed';
expect(activeTarget.hasAttribute('aria-checked')).to.be.eql(false);
expect(activeTarget.hasAttribute('aria-pressed')).to.be.eql(true);
expect(activeTarget.getAttribute('aria-pressed')).to.be.eql('true');
done();
} catch (e) {
done(e);
}
});
});
});
});

View file

@ -27,14 +27,14 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/polymerelements/iron-resizable-behavior",
"homepage": "https://github.com/PolymerElements/iron-resizable-behavior",
"_release": "1.0.2",
"_resolution": {
"type": "version",
"tag": "v1.0.2",
"commit": "85de8ba28be2bf17c81d6436ef1119022b003674"
},
"_source": "git://github.com/polymerelements/iron-resizable-behavior.git",
"_source": "git://github.com/PolymerElements/iron-resizable-behavior.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-resizable-behavior"
"_originalSource": "PolymerElements/iron-resizable-behavior"
}