limit resume to 8

This commit is contained in:
Luke Pulverenti 2016-03-08 13:47:36 -05:00
parent dd2b5bc15e
commit fb269362ff
7 changed files with 62 additions and 25 deletions

View File

@ -15,12 +15,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.1.25",
"_release": "1.1.25",
"version": "1.1.26",
"_release": "1.1.26",
"_resolution": {
"type": "version",
"tag": "1.1.25",
"commit": "0b6a10525c2143ac953dd9f8229e5eab2c2055bf"
"tag": "1.1.26",
"commit": "3cee1dd4f0c0b8727fbd8e03c77b989100082faa"
},
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "~1.1.5",

View File

@ -1,5 +1,29 @@
define(['isMobile'], function (isMobile) {
function isTv() {
// This is going to be really difficult to get right
var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf('tv') != -1) {
return true;
}
if (userAgent.indexOf('samsung') != -1) {
return true;
}
if (userAgent.indexOf('nintendo') != -1) {
return true;
}
if (userAgent.indexOf('viera') != -1) {
return true;
}
return false;
}
var uaMatch = function (ua) {
ua = ua.toLowerCase();
@ -68,5 +92,7 @@
browser.xboxOne = userAgent.toLowerCase().indexOf('xbox') != -1;
browser.animate = document.documentElement.animate != null;
browser.tv = isTv();
return browser;
});

View File

@ -1,6 +1,6 @@
{
"name": "iron-overlay-behavior",
"version": "1.4.1",
"version": "1.4.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for making an element an overlay",
"private": true,
@ -35,11 +35,11 @@
},
"ignore": [],
"homepage": "https://github.com/polymerelements/iron-overlay-behavior",
"_release": "1.4.1",
"_release": "1.4.2",
"_resolution": {
"type": "version",
"tag": "v1.4.1",
"commit": "4aefb7bc41aecef69022d6435133c430fc52d3ba"
"tag": "v1.4.2",
"commit": "565869d04433fb1065210ca30d81e7b7c4af73f8"
},
"_source": "git://github.com/polymerelements/iron-overlay-behavior.git",
"_target": "^1.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "iron-overlay-behavior",
"version": "1.4.1",
"version": "1.4.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for making an element an overlay",
"private": true,

View File

@ -243,6 +243,8 @@ context. You should place this element as a child of `<body>` whenever possible.
},
ready: function() {
// Used to skip calls to notifyResize and refit while the overlay is animating.
this.__isAnimating = false;
// with-backdrop needs tabindex to be set in order to trap the focus.
// If it is not set, IronOverlayBehavior will set it, and remove it if with-backdrop = false.
this.__shouldRemoveTabIndex = false;
@ -328,6 +330,7 @@ context. You should place this element as a child of `<body>` whenever possible.
this._manager.trackBackdrop(this);
this.__isAnimating = true;
if (this.opened) {
this._prepareRenderOpened();
}
@ -410,7 +413,7 @@ context. You should place this element as a child of `<body>` whenever possible.
// Needed to calculate the size of the overlay so that transitions on its size
// will have the correct starting points.
this._preparePositioning();
this.fit();
this.refit();
this._finishPositioning();
if (this.withBackdrop) {
@ -441,24 +444,23 @@ context. You should place this element as a child of `<body>` whenever possible.
},
_finishRenderOpened: function() {
// This ensures the overlay is visible before we set the focus
// (by calling _onIronResize -> refit).
this.notifyResize();
// Focus the child node with [autofocus]
this._applyFocus();
this.notifyResize();
this.__isAnimating = false;
this.fire('iron-overlay-opened');
},
_finishRenderClosed: function() {
// Hide the overlay and remove the backdrop.
this.resetFit();
this.style.display = 'none';
this._manager.removeOverlay(this);
this._applyFocus();
this.notifyResize();
this.notifyResize();
this.__isAnimating = false;
this.fire('iron-overlay-closed', this.closingReason);
},
@ -513,6 +515,10 @@ context. You should place this element as a child of `<body>` whenever possible.
},
_onIronResize: function() {
if (this.__isAnimating) {
return;
}
if (this.opened) {
this.refit();
}
@ -524,7 +530,7 @@ context. You should place this element as a child of `<body>` whenever possible.
* Can be overridden in order to avoid multiple observers on the same node.
*/
_onNodesChange: function() {
if (this.opened) {
if (this.opened && !this.__isAnimating) {
this.notifyResize();
}
// Store it so we don't query too much.

View File

@ -165,8 +165,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
test('open() triggers iron-resize', function(done) {
// Ignore the iron-resize on attached.
var callCount = -1;
var callCount = 0;
// Ignore iron-resize triggered by window resize.
window.addEventListener('resize', function() { callCount--; }, true);
overlay.addEventListener('iron-resize', function() { callCount++; });
@ -353,16 +352,22 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('overlay positioned & sized properly', function(done) {
overlay.addEventListener('iron-overlay-opened', function() {
var s = getComputedStyle(overlay);
assert.equal(parseFloat(s.left), (window.innerWidth - overlay.offsetWidth) / 2, 'centered horizontally');
assert.equal(parseFloat(s.top), (window.innerHeight - overlay.offsetHeight) / 2, 'centered vertically');
assert.closeTo(parseFloat(s.left), (window.innerWidth - overlay.offsetWidth) / 2, 1, 'centered horizontally');
assert.closeTo(parseFloat(s.top), (window.innerHeight - overlay.offsetHeight) / 2, 1, 'centered vertically');
done();
});
});
test('open overlay refits on iron-resize', function() {
test('open overlay refits on iron-resize', function(done) {
var spy = sinon.spy(overlay, 'refit');
// At this point, overlay is still opening.
overlay.fire('iron-resize');
assert.isTrue(spy.called, 'overlay should refit');
assert.isFalse(spy.called, 'overlay did not refit while animating');
overlay.addEventListener('iron-overlay-opened', function() {
overlay.fire('iron-resize');
assert.isTrue(spy.called, 'overlay did refit');
done();
});
});
});
@ -664,10 +669,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('backdrop is removed when toggling overlay opened', function(done) {
overlay.open();
assert.isObject(overlay.backdropElement.parentNode, 'backdrop is immediately inserted in the document');
assert.isOk(overlay.backdropElement.parentNode, 'backdrop is immediately inserted in the document');
runAfterClose(overlay, function() {
assert.isFalse(overlay.backdropElement.opened, 'backdrop is closed');
assert.isNotObject(overlay.backdropElement.parentNode, 'backdrop is removed from document');
assert.isNotOk(overlay.backdropElement.parentNode, 'backdrop is removed from document');
done();
});
});

View File

@ -418,7 +418,7 @@
SortOrder: "Descending",
MediaTypes: "Video",
Filters: "IsResumable",
Limit: screenWidth >= 1920 ? 10 : (screenWidth >= 1600 ? 8 : (screenWidth >= 1200 ? 9 : 6)),
Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1600 ? 8 : (screenWidth >= 1200 ? 9 : 6)),
Recursive: true,
Fields: "PrimaryImageAspectRatio,SyncInfo",
CollapseBoxSetItems: false,