From fc4068bdcc34b5a9128c9d53dfefcdd5946033a0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 26 Sep 2015 10:56:11 -0400 Subject: [PATCH] update now playing --- dashboard-ui/scripts/nowplayingpage.js | 26 ++++++++++++++++++++------ dashboard-ui/scripts/site.js | 2 -- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/dashboard-ui/scripts/nowplayingpage.js b/dashboard-ui/scripts/nowplayingpage.js index ffc1cc3214..a8fad308a5 100644 --- a/dashboard-ui/scripts/nowplayingpage.js +++ b/dashboard-ui/scripts/nowplayingpage.js @@ -776,15 +776,13 @@ if (AppInfo.enableNowPlayingPageBottomTabs) { tabs.classList.remove('hide'); - //page.classList.add('noSecondaryNavPage'); } else { tabs.classList.add('hide'); - //page.classList.remove('noSecondaryNavPage'); } tabs.classList.add('bottom'); tabs.alignBottom = true; - LibraryBrowser.configureSwipeTabs(page, tabs, page.querySelectorAll('neon-animated-pages')[0]); + LibraryBrowser.configureSwipeTabs(page, tabs, page.querySelector('neon-animated-pages')); $(tabs).on('iron-select', function () { page.querySelector('neon-animated-pages').selected = this.selected; @@ -802,8 +800,12 @@ $(page.querySelectorAll('.libraryViewNav a')).on('click', function () { var newSelected = this.getAttribute('data-index'); - tabs.selected = newSelected; - page.querySelector('neon-animated-pages').selected = newSelected; + + if (AppInfo.enableNowPlayingPageBottomTabs) { + tabs.selected = newSelected; + } else { + page.querySelector('neon-animated-pages').selected = newSelected; + } }); $(MediaController).on('playerchange', function () { @@ -826,7 +828,19 @@ var tab = window.location.hash; var selected = tab == '#playlist' ? 2 : 0;; - this.querySelectorAll('paper-tabs')[0].selected = selected; + + this.querySelector('paper-tabs').selected = selected; + + if (AppInfo.enableNowPlayingPageBottomTabs) { + this.querySelector('paper-tabs').selected = selected; + } else { + + // hack alert. doing this because the neon elements don't seem to be initialized yet + setTimeout(function() { + + page.querySelector('neon-animated-pages').selected = selected; + }, 1000); + } updateCastIcon(page); diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index ce4e17d953..a9d28b2fc8 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1729,7 +1729,6 @@ var AppInfo = {}; AppInfo.enableCustomHomeSections = true; AppInfo.enableHomeTabs = true; AppInfo.enableNowPlayingPageBottomTabs = true; - AppInfo.enableNowPlayingPageBottomTabs = false; AppInfo.enableAppStorePolicy = isCordova; @@ -1946,7 +1945,6 @@ var AppInfo = {}; Dashboard.importCss('themes/ios.css'); } } - Dashboard.importCss('themes/ios.css'); if ($.browser.msie && $.browser.tv && ($.browser.version || 11) <= 10) { Dashboard.importCss('thirdparty/paper-ie10.css');