From 30db5a009c32cc1e34141a4978bf491c81b9ea9d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 17 May 2016 01:45:06 -0400 Subject: [PATCH] update web-animations.html --- .../neon-animation/web-animations.html | 5 +++- dashboard-ui/components/viewcontainer-lite.js | 2 +- dashboard-ui/css/notifications.css | 2 ++ .../css/polymer/paper-icon-button-light.css | 3 ++- dashboard-ui/scripts/librarybrowser.js | 23 +++++++------------ dashboard-ui/scripts/livetvsuggested.js | 11 ++++----- 6 files changed, 21 insertions(+), 25 deletions(-) diff --git a/dashboard-ui/bower_components/neon-animation/web-animations.html b/dashboard-ui/bower_components/neon-animation/web-animations.html index c871854017..e8d6421e3b 100644 --- a/dashboard-ui/bower_components/neon-animation/web-animations.html +++ b/dashboard-ui/bower_components/neon-animation/web-animations.html @@ -8,4 +8,7 @@ Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt --> - + + \ No newline at end of file diff --git a/dashboard-ui/components/viewcontainer-lite.js b/dashboard-ui/components/viewcontainer-lite.js index 98395fc4ee..30e9837eee 100644 --- a/dashboard-ui/components/viewcontainer-lite.js +++ b/dashboard-ui/components/viewcontainer-lite.js @@ -373,7 +373,7 @@ define(['browser'], function (browser) { currentUrls = []; } - if (enableAnimation() && !browser.animate) { + if (enableAnimation() && !document.documentElement.animate) { require(['webAnimations']); } diff --git a/dashboard-ui/css/notifications.css b/dashboard-ui/css/notifications.css index 15302c3db5..1d144129c7 100644 --- a/dashboard-ui/css/notifications.css +++ b/dashboard-ui/css/notifications.css @@ -4,6 +4,8 @@ vertical-align: middle; width: auto; margin: 0; + padding-top: 0; + padding-bottom: 0; } .btnNotificationsInner { diff --git a/dashboard-ui/css/polymer/paper-icon-button-light.css b/dashboard-ui/css/polymer/paper-icon-button-light.css index b183d5967d..0e3900a60e 100644 --- a/dashboard-ui/css/polymer/paper-icon-button-light.css +++ b/dashboard-ui/css/polymer/paper-icon-button-light.css @@ -5,7 +5,8 @@ } [is=paper-icon-button-light] iron-icon, [is=paper-icon-button-light] img { - width: 100%; + /* Don't specify both dimensions or it may not get sized properly */ + /*width: 100%;*/ height: 100%; } diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index a6a7a97918..b2425cfac6 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -15,14 +15,14 @@ function fadeInRight(elem) { - var pct = browserInfo.mobile ? '2%' : '1%'; + var pct = browserInfo.mobile ? '2%' : '0.5%'; var keyframes = [ { opacity: '0', transform: 'translate3d(' + pct + ', 0, 0)', offset: 0 }, { opacity: '1', transform: 'none', offset: 1 }]; elem.animate(keyframes, { - duration: 300, + duration: 160, iterations: 1, easing: 'ease-out' }); @@ -40,21 +40,12 @@ return; } elem.animate(keyframes, { - duration: 160, + duration: 120, iterations: 1, easing: 'ease-out' }); } - function animateTabOnShow(newPanel, animateTabs, index) { - - if (animateTabs && animateTabs.indexOf(index) != -1 && /*browserInfo.animate &&*/ newPanel.animate) { - setTimeout(function () { - fadeInRight(newPanel); - }, 160); - } - } - var libraryBrowser = (function (window, document, screen) { // Regular Expressions for parsing tags and attributes @@ -301,11 +292,13 @@ var index = parseInt(link.getAttribute('data-index')); var newPanel = panels[index]; - animateTabOnShow(newPanel, animateTabs, index); - // If toCenter is called syncronously within the click event, it sometimes ends up canceling it setTimeout(function () { + if (animateTabs && animateTabs.indexOf(index) != -1 && /*browserInfo.animate &&*/ newPanel.animate) { + fadeInRight(newPanel); + } + tabs.dispatchEvent(new CustomEvent("tabchange", { detail: { selectedTabIndex: index @@ -315,7 +308,7 @@ newPanel.classList.add('is-active'); //scrollHelper.toCenter(tabs, link, true); - }, 160); + }, 120); } }); diff --git a/dashboard-ui/scripts/livetvsuggested.js b/dashboard-ui/scripts/livetvsuggested.js index 1850900114..d0722c1390 100644 --- a/dashboard-ui/scripts/livetvsuggested.js +++ b/dashboard-ui/scripts/livetvsuggested.js @@ -157,17 +157,21 @@ case 0: break; case 1: + document.body.classList.add('autoScrollY'); depends.push('scripts/livetvguide'); break; case 2: + document.body.classList.remove('autoScrollY'); depends.push('scripts/livetvchannels'); depends.push('paper-icon-item'); depends.push('paper-item-body'); break; case 3: + document.body.classList.remove('autoScrollY'); depends.push('scripts/livetvrecordings'); break; case 4: + document.body.classList.remove('autoScrollY'); depends.push('scripts/livetvseriestimers'); break; default: @@ -210,13 +214,6 @@ loadTab(view, parseInt(e.detail.selectedTabIndex)); }); - view.addEventListener('viewshow', function (e) { - - // Needed on the guide tab - // Ideally this should be moved to the guide tab on show/hide - document.body.classList.add('autoScrollY'); - }); - view.addEventListener('viewbeforehide', function (e) { document.body.classList.remove('autoScrollY');