From 2737d1f9f9aba38dc35a5cb8fd8a97bc3e8249e9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 2 Sep 2016 00:11:10 -0400 Subject: [PATCH] fixes #1958 - Title does not reset on home browse (Web Interface) --- .../emby-webcomponents/router.js | 9 +- .../viewmanager/viewmanager.js | 91 ++++++++----------- dashboard-ui/camerauploadsettings.html | 2 +- dashboard-ui/channelitems.html | 2 +- dashboard-ui/channels.html | 2 +- dashboard-ui/components/favoriteitems.js | 2 +- dashboard-ui/css/librarymenu.css | 4 +- dashboard-ui/devices/android/android.css | 6 +- dashboard-ui/devices/ios/ios.css | 4 + dashboard-ui/edititemmetadata.html | 2 +- dashboard-ui/livetv.html | 2 +- dashboard-ui/livetvitems.html | 2 +- dashboard-ui/livetvrecordinglist.html | 2 +- dashboard-ui/livetvseriestimer.html | 2 +- dashboard-ui/mypreferencesdisplay.html | 2 +- dashboard-ui/mypreferenceshome.html | 2 +- dashboard-ui/mypreferenceslanguages.html | 2 +- dashboard-ui/mypreferencesmenu.html | 2 +- dashboard-ui/myprofile.html | 2 +- dashboard-ui/mysync.html | 2 +- dashboard-ui/mysyncjob.html | 2 +- dashboard-ui/mysyncsettings.html | 2 +- dashboard-ui/nowplaying.html | 2 +- dashboard-ui/reports.html | 2 +- dashboard-ui/scripts/addpluginpage.js | 8 +- dashboard-ui/scripts/appservices.js | 6 +- dashboard-ui/scripts/itemdetailpage.js | 2 - dashboard-ui/scripts/itemlistpage.js | 1 - dashboard-ui/scripts/librarybrowser.js | 2 +- dashboard-ui/scripts/librarymenu.js | 34 +------ dashboard-ui/scripts/myprofile.js | 2 +- dashboard-ui/scripts/site.js | 15 +-- dashboard-ui/scripts/useredit.js | 2 +- dashboard-ui/scripts/userlibraryaccess.js | 2 +- dashboard-ui/scripts/userparentalcontrol.js | 2 +- dashboard-ui/scripts/userpassword.js | 2 +- dashboard-ui/scripts/userpasswordpage.js | 2 +- dashboard-ui/search.html | 2 +- dashboard-ui/secondaryitems.html | 2 +- 39 files changed, 97 insertions(+), 139 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/router.js b/dashboard-ui/bower_components/emby-webcomponents/router.js index fa9560b73b..e0349789d7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/router.js +++ b/dashboard-ui/bower_components/emby-webcomponents/router.js @@ -203,7 +203,7 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b return; //} } - viewManager.tryRestoreView(currentRequest).then(function () { + viewManager.tryRestoreView(currentRequest, function () { // done currentRouteInfo = { @@ -211,7 +211,12 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b path: ctx.path }; - }, onNewViewNeeded); + }).catch(function (result) { + + if (!result || !result.cancelled) { + onNewViewNeeded(); + } + }); } var firstConnectionResult; diff --git a/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewmanager.js b/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewmanager.js index c47efcc62d..ae7666acb6 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewmanager.js +++ b/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewmanager.js @@ -35,8 +35,6 @@ define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], functi function onViewChange(view, options, isRestore) { - var viewType = options.type; - var lastView = currentView; if (lastView) { dispatchViewEvent(lastView, 'viewhide'); @@ -123,67 +121,54 @@ define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], functi //events.on(connectionManager, 'localusersignedin', resetCachedViews); //events.on(connectionManager, 'localusersignedout', resetCachedViews); - function tryRestoreInternal(viewcontainer, options, resolve, reject) { + function ViewManager() { + } + + ViewManager.prototype.loadView = function (options) { + + var lastView = currentView; + + // Record the element that has focus + if (lastView) { + lastView.activeElement = document.activeElement; + } if (options.cancel) { return; } - viewcontainer.tryRestoreView(options).then(function (view) { + viewcontainer.loadView(options).then(function (view) { + onViewChange(view, options); + }); + }; + + ViewManager.prototype.tryRestoreView = function (options, onViewChanging) { + + if (options.cancel) { + return Promise.reject({ cancelled: true }); + } + + // Record the element that has focus + if (currentView) { + currentView.activeElement = document.activeElement; + } + + return viewcontainer.tryRestoreView(options).then(function (view) { + + onViewChanging(); onViewChange(view, options, true); - resolve(); - }, reject); - } + }); + }; - function ViewManager() { + ViewManager.prototype.currentView = function () { + return currentView; + }; - var self = this; - - self.loadView = function (options) { - - var lastView = currentView; - - // Record the element that has focus - if (lastView) { - lastView.activeElement = document.activeElement; - } - - if (options.cancel) { - return; - } - - viewcontainer.loadView(options).then(function (view) { - - onViewChange(view, options); - }); - }; - - self.tryRestoreView = function (options) { - return new Promise(function (resolve, reject) { - - if (options.cancel) { - return; - } - - // Record the element that has focus - if (currentView) { - currentView.activeElement = document.activeElement; - } - - tryRestoreInternal(viewcontainer, options, resolve, reject); - }); - }; - - self.currentView = function () { - return currentView; - }; - - self.dispatchPageEvents = function (value) { - dispatchPageEvents = value; - }; - } + ViewManager.prototype.dispatchPageEvents = function (value) { + dispatchPageEvents = value; + }; return new ViewManager(); }); diff --git a/dashboard-ui/camerauploadsettings.html b/dashboard-ui/camerauploadsettings.html index be983af99d..23db249355 100644 --- a/dashboard-ui/camerauploadsettings.html +++ b/dashboard-ui/camerauploadsettings.html @@ -1,4 +1,4 @@ -
+
diff --git a/dashboard-ui/channelitems.html b/dashboard-ui/channelitems.html index 50ad9fcd0f..ff26c6c913 100644 --- a/dashboard-ui/channelitems.html +++ b/dashboard-ui/channelitems.html @@ -1,4 +1,4 @@ -
+
diff --git a/dashboard-ui/channels.html b/dashboard-ui/channels.html index 4063a3e060..b429637f0b 100644 --- a/dashboard-ui/channels.html +++ b/dashboard-ui/channels.html @@ -1,4 +1,4 @@ -
+
diff --git a/dashboard-ui/components/favoriteitems.js b/dashboard-ui/components/favoriteitems.js index c730e3693f..7541bb83a5 100644 --- a/dashboard-ui/components/favoriteitems.js +++ b/dashboard-ui/components/favoriteitems.js @@ -75,7 +75,7 @@ html += '

' + Globalize.translate(section.name) + '

'; if (options.Limit && result.Items.length >= options.Limit) { - var href = "secondaryitems.html?type=" + section.types + "&filters=IsFavorite&titlekey=" + section.name; + var href = "secondaryitems.html?type=" + section.types + "&filters=IsFavorite"; html += ''; } diff --git a/dashboard-ui/css/librarymenu.css b/dashboard-ui/css/librarymenu.css index 5929d69cc7..1ff32f990c 100644 --- a/dashboard-ui/css/librarymenu.css +++ b/dashboard-ui/css/librarymenu.css @@ -91,7 +91,7 @@ .libraryMenuButtonText { text-decoration: none; - font-weight: 500 !important; + font-weight: 400 !important; display: inline-flex; vertical-align: middle; padding-left: 0 !important; @@ -102,7 +102,7 @@ overflow: hidden; text-overflow: ellipsis; align-items: center; - margin-left: .5em; + margin-left: .75em; font-size: 108%; } diff --git a/dashboard-ui/devices/android/android.css b/dashboard-ui/devices/android/android.css index a723091cf8..0e84f3622b 100644 --- a/dashboard-ui/devices/android/android.css +++ b/dashboard-ui/devices/android/android.css @@ -1,4 +1,8 @@ -@media all and (min-width: 300px) { +.libraryMenuButtonText { + font-weight: 500 !important; +} + +@media all and (min-width: 300px) { .libraryViewNav, .emby-tabs-slider { display: flex; diff --git a/dashboard-ui/devices/ios/ios.css b/dashboard-ui/devices/ios/ios.css index 146e33ba91..57fc14cbc6 100644 --- a/dashboard-ui/devices/ios/ios.css +++ b/dashboard-ui/devices/ios/ios.css @@ -72,6 +72,10 @@ h1, h1 a { font-weight: 400 !important; } +.libraryMenuButtonText { + font-weight: 500 !important; +} + .btnNotificationsInner { font-weight: 400; } diff --git a/dashboard-ui/edititemmetadata.html b/dashboard-ui/edititemmetadata.html index f3905adfa0..0b47befd16 100644 --- a/dashboard-ui/edititemmetadata.html +++ b/dashboard-ui/edititemmetadata.html @@ -1,4 +1,4 @@ -
+