From f00fc6ad15629484b3f7f8e857eed4b48762c1dd Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 16 May 2016 11:47:28 -0400 Subject: [PATCH 1/3] update viewcontainer-lite.js --- dashboard-ui/components/viewcontainer-lite.js | 33 +++++---------- dashboard-ui/devices/android/android.css | 4 +- dashboard-ui/scripts/site.js | 42 +------------------ 3 files changed, 13 insertions(+), 66 deletions(-) diff --git a/dashboard-ui/components/viewcontainer-lite.js b/dashboard-ui/components/viewcontainer-lite.js index dd70c1d2cb..e051efc3af 100644 --- a/dashboard-ui/components/viewcontainer-lite.js +++ b/dashboard-ui/components/viewcontainer-lite.js @@ -1,6 +1,7 @@ define(['browser'], function (browser) { var allPages = document.querySelectorAll('.mainAnimatedPage'); + var currentUrls = []; var pageContainerCount = allPages.length; var animationDuration = 500; var allowAnimation = true; @@ -98,6 +99,7 @@ define(['browser'], function (browser) { animate(animatable, previousAnimatable, options.transition, options.isBack).then(function () { selectedPageIndex = pageIndex; + currentUrls[pageIndex] = options.url; if (!options.cancel && previousAnimatable) { afterAnimate(allPages, pageIndex); } @@ -147,7 +149,7 @@ define(['browser'], function (browser) { function normalizeNewView(options) { if (options.view.indexOf('data-role="page"') == -1) { - var html = '
'; + var html = '
'; html += options.view; html += '
'; return html; @@ -158,7 +160,7 @@ define(['browser'], function (browser) { var elem = parseHtml(options.view, hasScript); elem.classList.add('page-view'); elem.setAttribute('data-type', options.type || ''); - elem.setAttribute('data-url', options.url); + return { elem: elem, hasScript: hasScript @@ -321,21 +323,13 @@ define(['browser'], function (browser) { function tryRestoreView(options) { var url = options.url; - var view = document.querySelector(".page-view[data-url='" + url + "']"); - var page = parentWithClass(view, 'mainAnimatedPage'); + var index = currentUrls.indexOf(url); - if (view) { + if (index != -1) { + var page = allPages[index]; + var view = page.querySelector(".page-view"); - var index = -1; - var pages = allPages; - for (var i = 0, length = pages.length; i < length; i++) { - if (pages[i] == page) { - index = i; - break; - } - } - - if (index != -1) { + if (view) { if (options.cancel) { return; @@ -377,14 +371,7 @@ define(['browser'], function (browser) { function reset() { - var views = document.querySelectorAll(".mainAnimatedPage.hide .page-view"); - - for (var i = 0, length = views.length; i < length; i++) { - - var view = views[i]; - triggerDestroy(view); - view.parentNode.removeChild(view); - } + currentUrls = []; } function parentWithClass(elem, className) { diff --git a/dashboard-ui/devices/android/android.css b/dashboard-ui/devices/android/android.css index e10e5c746a..39324cfaa4 100644 --- a/dashboard-ui/devices/android/android.css +++ b/dashboard-ui/devices/android/android.css @@ -10,9 +10,9 @@ font-weight: bold !important; } -/*.libraryViewNav { +.libraryViewNav { box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2); -}*/ +} @media all and (min-width: 300px) { diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 17bbe19a05..a0eebdad3f 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1166,7 +1166,7 @@ var Dashboard = { // The native app can handle a little bit more than safari if (AppInfo.isNativeApp) { - quality -= 10; + quality -= 5; } else { @@ -1183,11 +1183,6 @@ var Dashboard = { options.enableImageEnhancers = false; } - - if (AppInfo.forcedImageFormat && options.type != 'Logo') { - options.format = AppInfo.forcedImageFormat; - options.backgroundColor = '#1c1c1c'; - } }, loadExternalPlayer: function () { @@ -1472,8 +1467,6 @@ var AppInfo = {}; AppInfo.enableDetailPageChapters = false; AppInfo.enableDetailsMenuImages = false; AppInfo.enableMovieHomeSuggestions = false; - - AppInfo.forcedImageFormat = 'jpg'; } } @@ -1642,39 +1635,6 @@ var AppInfo = {}; }); } - function initFastClick() { - - require(["fastclick"], function (FastClick) { - - FastClick.attach(document.body, { - tapDelay: 0 - }); - - function parentWithClass(elem, className) { - - while (!elem.classList || !elem.classList.contains(className)) { - elem = elem.parentNode; - - if (!elem) { - return null; - } - } - - return elem; - } - - // Have to work around this issue of fast click breaking the panel dismiss - document.body.addEventListener('touchstart', function (e) { - - var tgt = parentWithClass(e.target, 'ui-panel-dismiss'); - if (tgt) { - $(tgt).click(); - } - }); - }); - - } - function setDocumentClasses(browser) { var elem = document.documentElement; From 3cc014002ed0a2e094edfdc88dbf3411b709a145 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 16 May 2016 13:11:49 -0400 Subject: [PATCH 2/3] update dialogs --- .../emby-webcomponents/.bower.json | 8 +-- .../emby-webcomponents/formdialog.css | 11 ++++ .../recordingcreator/recordingcreator.css | 4 +- .../recordingcreator.template.html | 7 +-- .../recordingeditor.template.html | 9 +-- .../iron-a11y-keys-behavior/.bower.json | 6 +- .../bower_components/polymer/.bower.json | 2 +- dashboard-ui/scripts/channels.js | 2 +- dashboard-ui/scripts/homenextup.js | 6 +- dashboard-ui/scripts/homeupcoming.js | 6 +- dashboard-ui/scripts/indexpage.js | 2 +- dashboard-ui/scripts/librarybrowser.js | 62 ++++++++++--------- dashboard-ui/scripts/livetvsuggested.js | 2 +- dashboard-ui/scripts/moviesrecommended.js | 2 +- dashboard-ui/scripts/musicrecommended.js | 2 +- dashboard-ui/scripts/sections.js | 6 +- dashboard-ui/scripts/site.js | 2 +- dashboard-ui/scripts/tvlatest.js | 8 +-- dashboard-ui/scripts/tvrecommended.js | 8 +-- dashboard-ui/scripts/tvupcoming.js | 6 +- 20 files changed, 71 insertions(+), 90 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 87bf172158..602289e4b3 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -16,12 +16,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.3.37", - "_release": "1.3.37", + "version": "1.3.39", + "_release": "1.3.39", "_resolution": { "type": "version", - "tag": "1.3.37", - "commit": "43c74d495f1fbdae6d86ac6608e934d396069806" + "tag": "1.3.39", + "commit": "51bc3e7758132f864fa17488be6f233a55537087" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/formdialog.css b/dashboard-ui/bower_components/emby-webcomponents/formdialog.css index e78a4c73dd..9d4555836e 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/formdialog.css +++ b/dashboard-ui/bower_components/emby-webcomponents/formdialog.css @@ -35,6 +35,10 @@ max-width: 700px; } +.formDialog .dialogContentTitle { + margin-top: 1em; +} + @media all and (min-width: 1000px) { .layout-tv .formDialog .centeredContent { @@ -42,6 +46,13 @@ } } +@media all and (max-height: 1400px) { + + .itemOverview { + display: none; + } +} + .layout-tv .formDialog .dialogHeader { padding-top: 1.5em; padding-bottom: 1.5em; diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css index 036c0f1d8c..4d0f8861e1 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css @@ -1,5 +1,5 @@ -.recordingDialog .btnSubmit { - background-color: #cc3333; +.recordingDialog .btnSubmit iron-icon { + color: #cc3333; } .layout-tv .btnHeaderSave { diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html index c2d1680643..89ae448bae 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html @@ -7,7 +7,7 @@
-

+

@@ -68,10 +68,7 @@

${HeaderEnjoyDayTrial}

${HeaderBecomeProjectSupporter}
- ${Record} + ${Record}
-
-
-
\ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingeditor.template.html b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingeditor.template.html index 0ef855f607..d3f29d68d7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingeditor.template.html +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingeditor.template.html @@ -13,7 +13,7 @@
-

+

@@ -24,7 +24,6 @@

-
@@ -33,11 +32,7 @@

-
- ${Save} -
-
-
+ ${Save}
\ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json index f920799d20..9604c48b0b 100644 --- a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json @@ -30,14 +30,14 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, "ignore": [], - "homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior", + "homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior", "_release": "1.1.2", "_resolution": { "type": "version", "tag": "v1.1.2", "commit": "0c2330c229a6fd3d200e2b84147ec6f94f17c22d" }, - "_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git", + "_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-a11y-keys-behavior" + "_originalSource": "PolymerElements/iron-a11y-keys-behavior" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/polymer/.bower.json b/dashboard-ui/bower_components/polymer/.bower.json index 3e8a4009a3..539707958b 100644 --- a/dashboard-ui/bower_components/polymer/.bower.json +++ b/dashboard-ui/bower_components/polymer/.bower.json @@ -34,6 +34,6 @@ "commit": "11c987b2eb3c73b388a79fc8aaea8ca01624f514" }, "_source": "git://github.com/Polymer/polymer.git", - "_target": "^1.0.0", + "_target": "^1.2.0", "_originalSource": "Polymer/polymer" } \ No newline at end of file diff --git a/dashboard-ui/scripts/channels.js b/dashboard-ui/scripts/channels.js index 124616ee80..8ecf9cf1b9 100644 --- a/dashboard-ui/scripts/channels.js +++ b/dashboard-ui/scripts/channels.js @@ -76,7 +76,7 @@ var mdlTabs = page.querySelector('.libraryViewNav'); - libraryBrowser.configurePaperLibraryTabs(page, mdlTabs, page.querySelectorAll('.pageTabContent'), true); + libraryBrowser.configurePaperLibraryTabs(page, mdlTabs, page.querySelectorAll('.pageTabContent'), [0, 1]); mdlTabs.addEventListener('tabchange', function (e) { loadTab(page, parseInt(e.detail.selectedTabIndex)); diff --git a/dashboard-ui/scripts/homenextup.js b/dashboard-ui/scripts/homenextup.js index ae7a38e4e6..6a6efcd7ff 100644 --- a/dashboard-ui/scripts/homenextup.js +++ b/dashboard-ui/scripts/homenextup.js @@ -9,13 +9,9 @@ function loadNextUp(page) { - var limit = AppInfo.hasLowImageBandwidth ? - 16 : - 24; - var query = { - Limit: limit, + Limit: 24, Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated,SyncInfo", UserId: Dashboard.getCurrentUserId(), ImageTypeLimit: 1, diff --git a/dashboard-ui/scripts/homeupcoming.js b/dashboard-ui/scripts/homeupcoming.js index 54a7beed86..3be899f292 100644 --- a/dashboard-ui/scripts/homeupcoming.js +++ b/dashboard-ui/scripts/homeupcoming.js @@ -3,13 +3,9 @@ function loadUpcoming(page) { Dashboard.showLoadingMsg(); - var limit = AppInfo.hasLowImageBandwidth && !enableScrollX() ? - 24 : - 40; - var query = { - Limit: limit, + Limit: 40, Fields: "AirTime,UserData,SeriesStudio,SyncInfo", UserId: Dashboard.getCurrentUserId(), ImageTypeLimit: 1, diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js index 1342d0c41b..6650571a89 100644 --- a/dashboard-ui/scripts/indexpage.js +++ b/dashboard-ui/scripts/indexpage.js @@ -249,7 +249,7 @@ var mdlTabs = view.querySelector('.libraryViewNav'); - libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent'), true); + libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent'), [0,1,2,3]); var tabControllers = []; var renderedTabs = []; diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 31a0453282..0e01a04fc1 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -13,6 +13,21 @@ return elem; } + function fadeInRight(elem) { + + var pct = browserInfo.mobile ? '2%' : '1%'; + + var keyframes = [ + { opacity: '0', transform: 'translate3d(' + pct + ', 0, 0)', offset: 0 }, + { opacity: '1', transform: 'none', offset: 1 }]; + + elem.animate(keyframes, { + duration: 300, + iterations: 1, + easing: 'ease-out' + }); + } + var libraryBrowser = (function (window, document, screen) { // Regular Expressions for parsing tags and attributes @@ -225,7 +240,7 @@ }); }, - configurePaperLibraryTabs: function (ownerpage, tabs, panels, animate) { + configurePaperLibraryTabs: function (ownerpage, tabs, panels, animateTabs) { if (!browserInfo.safari) { LibraryBrowser.configureSwipeTabs(ownerpage, tabs); @@ -241,21 +256,6 @@ tabs.classList.add('hiddenScrollX'); - function fadeInRight(elem) { - - var pct = browserInfo.mobile ? '1.5%' : '0.5%'; - - var keyframes = [ - { opacity: '0', transform: 'translate3d(' + pct + ', 0, 0)', offset: 0 }, - { opacity: '1', transform: 'none', offset: 1 }]; - - elem.animate(keyframes, { - duration: 300, - iterations: 1, - easing: 'ease-out' - }); - } - tabs.addEventListener('click', function (e) { var current = tabs.querySelector('.is-active'); @@ -267,24 +267,28 @@ current.classList.remove('is-active'); panels[parseInt(current.getAttribute('data-index'))].classList.remove('is-active'); } + link.classList.add('is-active'); var index = parseInt(link.getAttribute('data-index')); - tabs.dispatchEvent(new CustomEvent("tabchange", { - detail: { - selectedTabIndex: index - } - })); + var newPanel = panels[index]; - panels[index].classList.add('is-active'); - - if (browserInfo.animate && animate) { - fadeInRight(panels[index]); + if (animateTabs && animateTabs.indexOf(index) != -1 && /*browserInfo.animate &&*/ newPanel.animate) { + fadeInRight(newPanel); } // If toCenter is called syncronously within the click event, it sometimes ends up canceling it - //setTimeout(function() { - // scrollHelper.toCenter(tabs, link, true); - //}, 10); + setTimeout(function () { + + tabs.dispatchEvent(new CustomEvent("tabchange", { + detail: { + selectedTabIndex: index + } + })); + + newPanel.classList.add('is-active'); + + //scrollHelper.toCenter(tabs, link, true); + }, 100); } }); @@ -1722,7 +1726,7 @@ if (AppInfo.hasLowImageBandwidth) { if (!AppInfo.isNativeApp) { - screenWidth *= .7; + screenWidth *= .75; } } else { screenWidth *= 1.2; diff --git a/dashboard-ui/scripts/livetvsuggested.js b/dashboard-ui/scripts/livetvsuggested.js index 029afaf1bf..1850900114 100644 --- a/dashboard-ui/scripts/livetvsuggested.js +++ b/dashboard-ui/scripts/livetvsuggested.js @@ -204,7 +204,7 @@ baseUrl += '?topParentId=' + topParentId; } - libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent'), true); + libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent'), [0, 2, 3, 4]); mdlTabs.addEventListener('tabchange', function (e) { loadTab(view, parseInt(e.detail.selectedTabIndex)); diff --git a/dashboard-ui/scripts/moviesrecommended.js b/dashboard-ui/scripts/moviesrecommended.js index 086f143fed..203212b03b 100644 --- a/dashboard-ui/scripts/moviesrecommended.js +++ b/dashboard-ui/scripts/moviesrecommended.js @@ -303,7 +303,7 @@ baseUrl += '?topParentId=' + topParentId; } - libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent')); + libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent'), [0, 4, 5]); var tabControllers = []; var renderedTabs = []; diff --git a/dashboard-ui/scripts/musicrecommended.js b/dashboard-ui/scripts/musicrecommended.js index 5d5731bfb9..4c6b34d085 100644 --- a/dashboard-ui/scripts/musicrecommended.js +++ b/dashboard-ui/scripts/musicrecommended.js @@ -331,7 +331,7 @@ baseUrl += '?topParentId=' + topParentId; } - libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent')); + libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent'), [0, 4, 5, 6]); mdlTabs.addEventListener('tabchange', function (e) { loadTab(view, parseInt(e.detail.selectedTabIndex)); diff --git a/dashboard-ui/scripts/sections.js b/dashboard-ui/scripts/sections.js index cb5018ff46..66bed4a61c 100644 --- a/dashboard-ui/scripts/sections.js +++ b/dashboard-ui/scripts/sections.js @@ -246,13 +246,9 @@ function loadRecentlyAdded(elem, user) { - var limit = AppInfo.hasLowImageBandwidth ? - 16 : - 20; - var options = { - Limit: limit, + Limit: 20, Fields: "PrimaryImageAspectRatio,SyncInfo", ImageTypeLimit: 1, EnableImageTypes: "Primary,Backdrop,Thumb" diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index a0eebdad3f..a260d45cd2 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1166,7 +1166,7 @@ var Dashboard = { // The native app can handle a little bit more than safari if (AppInfo.isNativeApp) { - quality -= 5; + quality -= 10; } else { diff --git a/dashboard-ui/scripts/tvlatest.js b/dashboard-ui/scripts/tvlatest.js index 0d5c0357f9..3d958ca089 100644 --- a/dashboard-ui/scripts/tvlatest.js +++ b/dashboard-ui/scripts/tvlatest.js @@ -13,16 +13,10 @@ var parentId = params.topParentId; - var limit = 30; - - if (AppInfo.hasLowImageBandwidth) { - limit = 16; - } - var options = { IncludeItemTypes: "Episode", - Limit: limit, + Limit: 30, Fields: "PrimaryImageAspectRatio,SyncInfo", ParentId: parentId, ImageTypeLimit: 1, diff --git a/dashboard-ui/scripts/tvrecommended.js b/dashboard-ui/scripts/tvrecommended.js index 50faf2b823..9aefac9646 100644 --- a/dashboard-ui/scripts/tvrecommended.js +++ b/dashboard-ui/scripts/tvrecommended.js @@ -24,13 +24,9 @@ function loadNextUp() { - var limit = AppInfo.hasLowImageBandwidth ? - 16 : - 24; - var query = { - Limit: limit, + Limit: 24, Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated,SyncInfo", UserId: Dashboard.getCurrentUserId(), ImageTypeLimit: 1, @@ -258,7 +254,7 @@ view.querySelector('#resumableItems').classList.remove('hiddenScrollX'); } libraryBrowser.createCardMenus(view.querySelector('#resumableItems')); - libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent')); + libraryBrowser.configurePaperLibraryTabs(view, mdlTabs, view.querySelectorAll('.pageTabContent'), [0, 1, 2, 4, 5, 6]); mdlTabs.addEventListener('tabchange', function (e) { loadTab(view, parseInt(e.detail.selectedTabIndex)); diff --git a/dashboard-ui/scripts/tvupcoming.js b/dashboard-ui/scripts/tvupcoming.js index 27142bf92d..95c21592d1 100644 --- a/dashboard-ui/scripts/tvupcoming.js +++ b/dashboard-ui/scripts/tvupcoming.js @@ -4,13 +4,9 @@ Dashboard.showLoadingMsg(); - var limit = AppInfo.hasLowImageBandwidth && !enableScrollX() ? - 24 : - 40; - var query = { - Limit: limit, + Limit: 40, Fields: "AirTime,UserData,SeriesStudio,SyncInfo", UserId: Dashboard.getCurrentUserId(), ImageTypeLimit: 1, From 146daaccd095bb7546f6a5ce85a8daa84c91d7d1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 16 May 2016 14:20:08 -0400 Subject: [PATCH 3/3] optimize dlna views --- dashboard-ui/components/viewcontainer-lite.js | 46 ++++++------------- dashboard-ui/scripts/itemdetailpage.js | 2 + dashboard-ui/scripts/librarymenu.js | 12 +++-- dashboard-ui/scripts/site.js | 41 ++++++++++------- 4 files changed, 48 insertions(+), 53 deletions(-) diff --git a/dashboard-ui/components/viewcontainer-lite.js b/dashboard-ui/components/viewcontainer-lite.js index e051efc3af..98395fc4ee 100644 --- a/dashboard-ui/components/viewcontainer-lite.js +++ b/dashboard-ui/components/viewcontainer-lite.js @@ -3,7 +3,6 @@ define(['browser'], function (browser) { var allPages = document.querySelectorAll('.mainAnimatedPage'); var currentUrls = []; var pageContainerCount = allPages.length; - var animationDuration = 500; var allowAnimation = true; var selectedPageIndex = -1; @@ -104,6 +103,11 @@ define(['browser'], function (browser) { afterAnimate(allPages, pageIndex); } + // Temporary hack + // If a view renders UI in viewbeforeshow the lazy image loader will think the images aren't visible and won't load images + // The views need to be updated to start loading data in beforeshow, but not render until show + document.dispatchEvent(new CustomEvent('scroll', {})); + $.mobile = $.mobile || {}; $.mobile.activePage = view; @@ -249,7 +253,7 @@ define(['browser'], function (browser) { function fade(newAnimatedPage, oldAnimatedPage, transition, isBack) { var timings = { - duration: animationDuration, + duration: 140, iterations: 1, easing: 'ease-out', fill: 'both' @@ -305,16 +309,6 @@ define(['browser'], function (browser) { onBeforeChange = fn; } - function sendResolve(resolve, view) { - - // Don't report completion until the animation has finished, otherwise rendering may not perform well - setTimeout(function () { - - resolve(view); - - }, animationDuration); - } - function getSelectedIndex(allPages) { return selectedPageIndex; @@ -354,6 +348,11 @@ define(['browser'], function (browser) { afterAnimate(allPages, index); } + // Temporary hack + // If a view renders UI in viewbeforeshow the lazy image loader will think the images aren't visible and won't load images + // The views need to be updated to start loading data in beforeshow, but not render until show + document.dispatchEvent(new CustomEvent('scroll', {})); + $.mobile = $.mobile || {}; $.mobile.activePage = view; @@ -374,31 +373,14 @@ define(['browser'], function (browser) { currentUrls = []; } - function parentWithClass(elem, className) { - - while (!elem.classList || !elem.classList.contains(className)) { - elem = elem.parentNode; - - if (!elem) { - return null; - } - } - - return elem; - } - - function init(isAnimationAllowed) { - - if (allowAnimation && enableAnimation() && !browser.animate) { - require(['webAnimations']); - } + if (enableAnimation() && !browser.animate) { + require(['webAnimations']); } return { loadView: loadView, tryRestoreView: tryRestoreView, reset: reset, - setOnBeforeChange: setOnBeforeChange, - init: init + setOnBeforeChange: setOnBeforeChange }; }); \ No newline at end of file diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 18db76b4ee..f7bdfeb3e1 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -63,6 +63,8 @@ Dashboard.getCurrentUser().then(function (user) { + window.scrollTo(0, 0); + renderImage(page, item, user); setInitialCollapsibleState(page, item, context, user); diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index 36fcfd99c2..c5323c1f6e 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -737,12 +737,14 @@ var html = title; - var page = $.mobile.activePage; - if (page) { - var helpUrl = page.getAttribute('data-helpurl'); + if (window.$ && $.mobile) { + var page = $.mobile.activePage; + if (page) { + var helpUrl = page.getAttribute('data-helpurl'); - if (helpUrl) { - html += 'Help'; + if (helpUrl) { + html += 'Help'; + } } } diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index a260d45cd2..f267cae112 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1752,7 +1752,8 @@ var AppInfo = {}; globalize: embyWebComponentsBowerPath + "/globalize", itemHelper: embyWebComponentsBowerPath + '/itemhelper', itemShortcuts: embyWebComponentsBowerPath + "/shortcuts", - imageLoader: embyWebComponentsBowerPath + "/images/imagehelper" + imageLoader: embyWebComponentsBowerPath + "/images/imagehelper", + webAnimations: bowerPath + '/web-animations-js/web-animations-next-lite.min' }; if (navigator.webkitPersistentStorage) { @@ -2348,13 +2349,15 @@ var AppInfo = {}; defineRoute({ path: '/channelitems.html', dependencies: [], - autoFocus: false + autoFocus: false, + transition: 'fade' }); defineRoute({ path: '/channels.html', dependencies: [], - autoFocus: false + autoFocus: false, + transition: 'fade' }); defineRoute({ @@ -2522,7 +2525,8 @@ var AppInfo = {}; path: '/home.html', dependencies: [], autoFocus: false, - controller: 'scripts/indexpage' + controller: 'scripts/indexpage', + transition: 'fade' }); defineRoute({ @@ -2535,14 +2539,16 @@ var AppInfo = {}; defineRoute({ path: '/itemdetails.html', dependencies: ['paper-button'], - autoFocus: false + autoFocus: false, + transition: 'fade' }); defineRoute({ path: '/itemlist.html', dependencies: ['paper-checkbox', 'scripts/alphapicker'], autoFocus: false, - controller: 'scripts/itemlistpage' + controller: 'scripts/itemlistpage', + transition: 'fade' }); defineRoute({ @@ -2576,7 +2582,8 @@ var AppInfo = {}; path: '/livetv.html', dependencies: ['paper-button', 'livetvcss'], controller: 'scripts/livetvsuggested', - autoFocus: false + autoFocus: false, + transition: 'fade' }); defineRoute({ @@ -2692,14 +2699,16 @@ var AppInfo = {}; path: '/movies.html', dependencies: ['paper-checkbox', 'paper-fab', 'scripts/alphapicker', 'paper-button'], autoFocus: false, - controller: 'scripts/moviesrecommended' + controller: 'scripts/moviesrecommended', + transition: 'fade' }); defineRoute({ path: '/music.html', dependencies: ['scripts/alphapicker'], controller: 'scripts/musicrecommended', - autoFocus: false + autoFocus: false, + transition: 'fade' }); defineRoute({ @@ -2781,7 +2790,8 @@ var AppInfo = {}; defineRoute({ path: '/photos.html', dependencies: [], - autoFocus: false + autoFocus: false, + transition: 'fade' }); defineRoute({ @@ -2794,7 +2804,8 @@ var AppInfo = {}; defineRoute({ path: '/playlists.html', dependencies: [], - autoFocus: false + autoFocus: false, + transition: 'fade' }); defineRoute({ @@ -2908,7 +2919,8 @@ var AppInfo = {}; path: '/tv.html', dependencies: ['paper-checkbox', 'paper-icon-button-light', 'paper-button'], autoFocus: false, - controller: 'scripts/tvrecommended' + controller: 'scripts/tvrecommended', + transition: 'fade' }); defineRoute({ @@ -3242,6 +3254,7 @@ pageClassOn('viewinit', "page", function () { page.classList.add("ui-page"); page.classList.add("ui-page-theme-" + current); + page.classList.add("ui-body-" + current); var contents = page.querySelectorAll("div[data-role='content']"); @@ -3269,13 +3282,9 @@ pageClassOn('viewshow', "page", function () { if (currentTheme == 'a') { docElem.classList.add('background-theme-a'); docElem.classList.remove('background-theme-b'); - page.classList.add('ui-body-a'); - page.classList.remove('ui-body-b'); } else { docElem.classList.add('background-theme-b'); docElem.classList.remove('background-theme-a'); - page.classList.add('ui-body-b'); - page.classList.remove('ui-body-a'); } var apiClient = window.ApiClient;