diff --git a/src/components/homesections/homesections.css b/src/components/homesections/homesections.css
index 647a9500d4..45df67c482 100644
--- a/src/components/homesections/homesections.css
+++ b/src/components/homesections/homesections.css
@@ -8,4 +8,18 @@
.homeLibraryButton {
width: 46% !important;
}
-}
\ No newline at end of file
+}
+
+.homeLibraryIcon {
+ margin-left: .5em;
+ margin-right: .5em;
+ -webkit-flex-shrink: 0;
+ flex-shrink: 0
+}
+
+.homeLibraryText {
+ white-space: nowrap;
+ -o-text-overflow: ellipsis;
+ text-overflow: ellipsis;
+ overflow: hidden
+}
diff --git a/src/components/homesections/homesections.js b/src/components/homesections/homesections.js
index 2f4f51e398..cf1456a12a 100644
--- a/src/components/homesections/homesections.js
+++ b/src/components/homesections/homesections.js
@@ -1,10 +1,8 @@
-define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'layoutManager', 'imageLoader', 'globalize', 'itemShortcuts', 'itemHelper', 'appRouter', 'paper-icon-button-light', 'emby-itemscontainer', 'emby-scroller', 'emby-button', 'css!./homesections'], function (connectionManager, cardBuilder, appSettings, dom, appHost, layoutManager, imageLoader, globalize, itemShortcuts, itemHelper, appRouter) {
+define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'layoutManager', 'imageLoader', 'globalize', 'itemShortcuts', 'itemHelper', 'appRouter', 'scripts/imagehelper','paper-icon-button-light', 'emby-itemscontainer', 'emby-scroller', 'emby-button', 'css!./homesections'], function (connectionManager, cardBuilder, appSettings, dom, appHost, layoutManager, imageLoader, globalize, itemShortcuts, itemHelper, appRouter, imageHelper) {
'use strict';
function getDefaultSection(index) {
-
switch (index) {
-
case 0:
return 'smalllibrarytiles';
case 1:
@@ -25,13 +23,9 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
}
function getAllSectionsToShow(userSettings, sectionCount) {
-
var sections = [];
-
for (var i = 0, length = sectionCount; i < length; i++) {
-
var section = userSettings.get('homesection' + i) || getDefaultSection(i);
-
if (section === 'folders') {
section = getDefaultSection(0);
}
@@ -43,15 +37,11 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
}
function loadSections(elem, apiClient, user, userSettings) {
-
return getUserViews(apiClient, user.Id).then(function (userViews) {
-
- var i, length;
- var sectionCount = 7;
-
var html = '';
- for (i = 0, length = sectionCount; i < length; i++) {
+ var sectionCount = 7;
+ for (var i = 0; i < sectionCount; i++) {
html += '
';
}
@@ -60,14 +50,11 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
var promises = [];
var sections = getAllSectionsToShow(userSettings, sectionCount);
-
- for (i = 0, length = sections.length; i < length; i++) {
-
+ for (var i = 0; i < sections.length; i++) {
promises.push(loadSection(elem, apiClient, user, userSettings, userViews, sections, i));
}
return Promise.all(promises).then(function () {
-
return resume(elem, {
refresh: true,
returnPromise: false
@@ -77,12 +64,8 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
}
function destroySections(elem) {
-
var elems = elem.querySelectorAll('.itemsContainer');
- var i, length;
-
- for (i = 0, length = elems.length; i < length; i++) {
-
+ for (var i = 0; i < elems.length; i++) {
elems[i].fetchData = null;
elems[i].parentContainer = null;
elems[i].getItemsHtml = null;
@@ -92,17 +75,13 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
}
function pause(elem) {
-
var elems = elem.querySelectorAll('.itemsContainer');
- var i, length;
- for (i = 0, length = elems.length; i < length; i++) {
-
+ for (var i = 0; i < elems.length; i++) {
elems[i].pause();
}
}
function resume(elem, options) {
-
var elems = elem.querySelectorAll('.itemsContainer');
var i, length;
var promises = [];
@@ -112,7 +91,6 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
}
var promise = Promise.all(promises);
-
if (!options || options.returnPromise !== false) {
return promise;
}
@@ -127,41 +105,29 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
if (section === 'latestmedia') {
loadRecentlyAdded(elem, apiClient, user, userViews);
- }
- else if (section === 'librarytiles' || section === 'smalllibrarytiles' || section === 'smalllibrarytiles-automobile' || section === 'librarytiles-automobile') {
+ } else if (section === 'librarytiles' || section === 'smalllibrarytiles' || section === 'smalllibrarytiles-automobile' || section === 'librarytiles-automobile') {
loadLibraryTiles(elem, apiClient, user, userSettings, 'smallBackdrop', userViews, allSections);
- }
- else if (section === 'librarybuttons') {
+ } else if (section === 'librarybuttons') {
loadlibraryButtons(elem, apiClient, user, userSettings, userViews, allSections);
- }
- else if (section === 'resume') {
+ } else if (section === 'resume') {
loadResumeVideo(elem, apiClient, userId);
- }
- else if (section === 'resumeaudio') {
+ } else if (section === 'resumeaudio') {
loadResumeAudio(elem, apiClient, userId);
- }
- else if (section === 'activerecordings') {
+ } else if (section === 'activerecordings') {
loadLatestLiveTvRecordings(elem, true, apiClient, userId);
- }
- else if (section === 'nextup') {
+ } else if (section === 'nextup') {
loadNextUp(elem, apiClient, userId);
- }
- else if (section === 'onnow' || section === 'livetv') {
+ } else if (section === 'onnow' || section === 'livetv') {
return loadOnNow(elem, apiClient, user);
- }
- else {
-
+ } else {
elem.innerHTML = '';
-
return Promise.resolve();
}
return Promise.resolve();
}
function getUserViews(apiClient, userId) {
-
return apiClient.getUserViews({}, userId || apiClient.getCurrentUserId()).then(function (result) {
-
return result.Items;
});
}
@@ -186,56 +152,15 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
var html = "";
html += '