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

update polymer components

This commit is contained in:
Luke Pulverenti 2015-11-18 21:36:19 -05:00
parent aa272fb404
commit 8fe136f23c
17 changed files with 183 additions and 180 deletions

View file

@ -1,6 +1,6 @@
{
"name": "paper-input",
"version": "1.1.0",
"version": "1.1.1",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
@ -27,7 +27,7 @@
"homepage": "https://github.com/PolymerElements/paper-input",
"ignore": [],
"dependencies": {
"polymer": "Polymer/polymer#^1.2.0",
"polymer": "Polymer/polymer#^1.1.0",
"iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.0",
"iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",
@ -44,11 +44,11 @@
"web-component-tester": "Polymer/web-component-tester#^3.3.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.1.0",
"_release": "1.1.1",
"_resolution": {
"type": "version",
"tag": "v1.1.0",
"commit": "4da53c84914bea289a1748dcaf883d48801ec9e3"
"tag": "v1.1.1",
"commit": "1bbce220b027dc030b294163f7da6f3e9052ab13"
},
"_source": "git://github.com/polymerelements/paper-input.git",
"_target": "^1.0.9",

View file

@ -1,28 +1,22 @@
language: node_js
sudo: false
matrix:
include:
- node_js: stable
script: xvfb-run wct
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- node_js: node
script:
- |
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
wct -s 'default'
fi
before_script:
- npm install web-component-tester
- npm install bower
- export PATH=$PWD/node_modules/.bin:$PATH
- bower install
- npm install web-component-tester
- npm install bower
- 'export PATH=$PWD/node_modules/.bin:$PATH'
- bower install
env:
global:
- secure: TcDqx+YdNCa/DRQjdKt9dgYCPgXtPl2EZ7Nnv6bRvbcmUjW2eSr7Zwb+e0fO8wgwms/RqFaVx+u5jo7D1lnC4Ybcg1HKiMOvCyzY36MjF9oB/VKSEUC+p4tMVQfw1IZ/RmK3dD+WEWaoT/EKmNfctz7v5kR+yk2lZo44D9I7rrc=
- secure: nh65tvhnhOrK05qKvDJKMV7Jm9yiCoG1wFkP3ZnqOHix9Ny+KmcTa41Bl6NXQdvYaMTFtzS7lMZX5cqIziyKyGWHVN30LzGMHJNz12fhcMi3nJ84trhQGcu/9qR9yDv16q9ouGlcz1VxnDOHaRAHnIKjLIbhN3aJtMtZBbnWihA=
- secure: TcDqx+YdNCa/DRQjdKt9dgYCPgXtPl2EZ7Nnv6bRvbcmUjW2eSr7Zwb+e0fO8wgwms/RqFaVx+u5jo7D1lnC4Ybcg1HKiMOvCyzY36MjF9oB/VKSEUC+p4tMVQfw1IZ/RmK3dD+WEWaoT/EKmNfctz7v5kR+yk2lZo44D9I7rrc=
- secure: nh65tvhnhOrK05qKvDJKMV7Jm9yiCoG1wFkP3ZnqOHix9Ny+KmcTa41Bl6NXQdvYaMTFtzS7lMZX5cqIziyKyGWHVN30LzGMHJNz12fhcMi3nJ84trhQGcu/9qR9yDv16q9ouGlcz1VxnDOHaRAHnIKjLIbhN3aJtMtZBbnWihA=
node_js: 4
addons:
firefox: '42.0'
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
script:
- xvfb-run wct
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"

View file

@ -1,6 +1,6 @@
{
"name": "paper-input",
"version": "1.1.0",
"version": "1.1.1",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
@ -27,7 +27,7 @@
"homepage": "https://github.com/PolymerElements/paper-input",
"ignore": [],
"dependencies": {
"polymer": "Polymer/polymer#^1.2.0",
"polymer": "Polymer/polymer#^1.1.0",
"iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.0",
"iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",

View file

@ -461,21 +461,6 @@ This element is `display:block` by default, but you can set the `inline` attribu
} else {
this._handleValue(this._inputElement);
}
this._numberOfPrefixNodes = 0;
this._prefixObserver = Polymer.dom(this.$.prefix).observeNodes(
function(mutations) {
// Keep track whether there's at least one prefix node, since it
// affects laying out the floating label.
this._numberOfPrefixNodes += mutations.addedNodes.length -
mutations.removedNodes.length;
}.bind(this));
},
detached: function() {
if (this._prefixObserver) {
Polymer.dom(this.$.prefix).unobserveNodes(this._prefixObserver);
}
},
_onAddonAttached: function(event) {
@ -567,16 +552,15 @@ This element is `display:block` by default, but you can set the `inline` attribu
if (alwaysFloatLabel || _inputHasContent) {
cls += ' label-is-floating';
// If the label is floating, ignore any offsets that may have been
// applied from a prefix element.
this.$.labelAndInputContainer.style.position = 'static';
if (invalid) {
cls += ' is-invalid';
} else if (focused) {
cls += " label-is-highlighted";
}
// If a prefix element exists, the label has a horizontal offset
// which needs to be undone when displayed as a floating label.
if (this._numberOfPrefixNodes > 0) {
this.$.labelAndInputContainer.style.position = 'static';
}
} else {
// When the label is not floating, it should overlap the input element.
if (label) {

View file

@ -40,6 +40,26 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="prefix">
<template>
<paper-input-container>
<div prefix>$</div>
<label id="l">label</label>
<input is="iron-input" id="i">
</paper-input-container>
</template>
</test-fixture>
<test-fixture id="prefix-has-value">
<template>
<paper-input-container>
<div prefix>$</div>
<label id="l">label</label>
<input is="iron-input" id="i" value="foo">
</paper-input-container>
</template>
</test-fixture>
<test-fixture id="has-value">
<template>
<paper-input-container>
@ -119,9 +139,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.equal(getComputedStyle(container.querySelector('#l')).visibility, 'visible', 'label has visibility:visible');
});
test('label is floated if value is initialized to not null', function() {
test('label is floated if value is initialized to not null', function(done) {
var container = fixture('has-value');
assert.notEqual(getTransform(container.querySelector('#l')), 'none', 'label has transform');
requestAnimationFrame(function() {
assert.notEqual(getTransform(container.querySelector('#l')), 'none', 'label has transform');
done();
});
});
test('label is invisible if no-label-float and value is initialized to not null', function() {
@ -132,7 +155,36 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('label is floated if always-float-label is true', function() {
var container = fixture('always-float');
assert.notEqual(getTransform(container.querySelector('#l')), 'none', 'label has transform');
})
});
test('label is floated correctly with a prefix', function(done) {
var container = fixture('prefix');
var label = Polymer.dom(container).querySelector('#l');
var input = Polymer.dom(container).querySelector('#i');
// Label is initially visible.
assert.equal(getComputedStyle(label).visibility, 'visible', 'label has visibility:visible');
// After entering text, the label floats, and it is not indented.
input.bindValue = 'foobar';
requestAnimationFrame(function() {
assert.notEqual(getTransform(label), 'none', 'label has transform');
assert.equal(label.getBoundingClientRect().left, container.getBoundingClientRect().left);
done();
});
});
test('label is floated correctly with a prefix and prefilled value', function(done) {
var container = fixture('prefix-has-value');
var label = Polymer.dom(container).querySelector('#l');
// The label floats, and it is not indented.
requestAnimationFrame(function() {
assert.notEqual(getTransform(label), 'none', 'label has transform');
assert.equal(label.getBoundingClientRect().left, container.getBoundingClientRect().left);
done();
});
});
});