From fb269362ff0e3580d70e469aa3c61b1884cf3bff Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 8 Mar 2016 13:47:36 -0500 Subject: [PATCH] limit resume to 8 --- .../emby-webcomponents/.bower.json | 8 +++--- .../emby-webcomponents/browser.js | 26 +++++++++++++++++++ .../iron-overlay-behavior/.bower.json | 8 +++--- .../iron-overlay-behavior/bower.json | 2 +- .../iron-overlay-behavior.html | 20 +++++++++----- .../test/iron-overlay-behavior.html | 21 +++++++++------ dashboard-ui/scripts/sections.js | 2 +- 7 files changed, 62 insertions(+), 25 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 90d76b0b70..29f50bf2e0 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -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", diff --git a/dashboard-ui/bower_components/emby-webcomponents/browser.js b/dashboard-ui/bower_components/emby-webcomponents/browser.js index 63afa16635..f55af6fddf 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/browser.js +++ b/dashboard-ui/bower_components/emby-webcomponents/browser.js @@ -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; }); \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json index 9dad6b0a0c..c8f51831c4 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json @@ -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", diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/bower.json index 805ca3ab9b..8232d06df7 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/bower.json +++ b/dashboard-ui/bower_components/iron-overlay-behavior/bower.json @@ -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, diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html index e02eba15d8..49c5cf2861 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html +++ b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html @@ -243,6 +243,8 @@ context. You should place this element as a child of `` 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 `` 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 `` 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 `` 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 `` 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 `` 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. diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html b/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html index 69d0c73423..7e4a92fb61 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html +++ b/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html @@ -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(); }); }); diff --git a/dashboard-ui/scripts/sections.js b/dashboard-ui/scripts/sections.js index 1c26cac2c1..de5f1afa33 100644 --- a/dashboard-ui/scripts/sections.js +++ b/dashboard-ui/scripts/sections.js @@ -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,