mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
merge from dev
This commit is contained in:
parent
1c8f02ce0f
commit
33b01d778c
911 changed files with 34157 additions and 57125 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-range-behavior",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for something with a minimum and maximum value",
|
||||
"authors": "The Polymer Authors",
|
||||
|
@ -28,11 +28,11 @@
|
|||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-range-behavior",
|
||||
"_release": "1.0.3",
|
||||
"_release": "1.0.4",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.3",
|
||||
"commit": "3ed9a372778e31e62477666b313155c581a7dfe6"
|
||||
"tag": "v1.0.4",
|
||||
"commit": "71774a7d8a8c377496bfe05e60b754e91216e0b9"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-range-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-range-behavior",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for something with a minimum and maximum value",
|
||||
"authors": "The Polymer Authors",
|
||||
|
|
|
@ -12,11 +12,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<script>
|
||||
|
||||
/**
|
||||
/**
|
||||
* `iron-range-behavior` provides the behavior for something with a minimum to maximum range.
|
||||
*
|
||||
* @demo demo/index.html
|
||||
* @polymerBehavior
|
||||
* @polymerBehavior
|
||||
*/
|
||||
Polymer.IronRangeBehavior = {
|
||||
|
||||
|
@ -85,7 +85,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
_calcStep: function(value) {
|
||||
/**
|
||||
* if we calculate the step using
|
||||
* `Math.round(value / step) * step` we may hit a precision point issue
|
||||
* `Math.round(value / step) * step` we may hit a precision point issue
|
||||
* eg. 0.1 * 0.2 = 0.020000000000000004
|
||||
* http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
|
||||
*
|
||||
|
@ -93,7 +93,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
*/
|
||||
// polymer/issues/2493
|
||||
value = parseFloat(value);
|
||||
return this.step ? (Math.round((value + this.min) / this.step) / (1 / this.step)) - this.min : value;
|
||||
return this.step ? (Math.round((value + this.min) / this.step) -
|
||||
(this.min / this.step)) / (1 / this.step) : value;
|
||||
},
|
||||
|
||||
_validateValue: function() {
|
||||
|
|
|
@ -103,7 +103,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
});
|
||||
|
||||
test('odd values', function() {
|
||||
test('odd values', function(done) {
|
||||
range.min = 1;
|
||||
range.max = 7;
|
||||
range.step = 2;
|
||||
|
@ -117,6 +117,31 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
range.value += range.step;
|
||||
assert.equal(range.value, 7);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('negative values should round up', function(done) {
|
||||
range.min = -10;
|
||||
range.max = 10;
|
||||
range.step = 0.1;
|
||||
range.value = -8.4252;
|
||||
|
||||
flush(function() {
|
||||
assert.equal(range.value, -8.4);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('positive values should round up', function(done) {
|
||||
range.min = 10;
|
||||
range.max = 100;
|
||||
range.step = 0.25;
|
||||
range.value = 19.34567;
|
||||
|
||||
flush(function() {
|
||||
assert.equal(range.value, 19.25);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue