From 7c293a7dd185a37ae179e3062486318cfc07c552 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 14 Mar 2015 21:58:06 -0400 Subject: [PATCH] add setting to hide library tile names --- dashboard-ui/mypreferenceswebclient.html | 6 ++++++ dashboard-ui/scripts/indexpage.js | 14 ++++++++------ dashboard-ui/scripts/mypreferenceswebclient.js | 3 +++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/dashboard-ui/mypreferenceswebclient.html b/dashboard-ui/mypreferenceswebclient.html index e2ae1b04c..be0a9ff1e 100644 --- a/dashboard-ui/mypreferenceswebclient.html +++ b/dashboard-ui/mypreferenceswebclient.html @@ -85,6 +85,12 @@ +
+
+ + +
${LabelShowLibraryTileNamesHelp}
+
diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js index 2d0e21d82..e2df11fcb 100644 --- a/dashboard-ui/scripts/indexpage.js +++ b/dashboard-ui/scripts/indexpage.js @@ -192,7 +192,7 @@ }); } - function loadLibraryTiles(elem, userId, shape, index, autoHideOnMobile) { + function loadLibraryTiles(elem, userId, shape, index, autoHideOnMobile, showTitles) { if (autoHideOnMobile) { $(elem).addClass('hiddenSectionOnMobile'); @@ -217,7 +217,7 @@ html += LibraryBrowser.getPosterViewHtml({ items: items, shape: shape, - showTitle: true, + showTitle: showTitles, centerText: true, lazy: true, autoThumb: true, @@ -479,22 +479,24 @@ var section = displayPreferences.CustomPrefs['home' + index] || getDefaultSection(index); + var showLibraryTileNames = displayPreferences.CustomPrefs.enableLibraryTileNames != '0'; + var elem = $('.section' + index, page); if (section == 'latestmedia') { Sections.loadRecentlyAdded(elem, userId); } else if (section == 'librarytiles') { - Sections.loadLibraryTiles(elem, userId, 'backdrop', index); + Sections.loadLibraryTiles(elem, userId, 'backdrop', index, false, showLibraryTileNames); } else if (section == 'smalllibrarytiles') { - Sections.loadLibraryTiles(elem, userId, 'homePageSmallBackdrop', index); + Sections.loadLibraryTiles(elem, userId, 'homePageSmallBackdrop', index, false, showLibraryTileNames); } else if (section == 'smalllibrarytiles-automobile') { - Sections.loadLibraryTiles(elem, userId, 'homePageSmallBackdrop', index, true); + Sections.loadLibraryTiles(elem, userId, 'homePageSmallBackdrop', index, true, showLibraryTileNames); } else if (section == 'librarytiles-automobile') { - Sections.loadLibraryTiles(elem, userId, 'backdrop', index, true); + Sections.loadLibraryTiles(elem, userId, 'backdrop', index, true, showLibraryTileNames); } else if (section == 'librarybuttons') { Sections.loadlibraryButtons(elem, userId, index); diff --git a/dashboard-ui/scripts/mypreferenceswebclient.js b/dashboard-ui/scripts/mypreferenceswebclient.js index 16b4ceb56..66e6f68a0 100644 --- a/dashboard-ui/scripts/mypreferenceswebclient.js +++ b/dashboard-ui/scripts/mypreferenceswebclient.js @@ -25,6 +25,8 @@ $('#selectHomeSection3', page).val(displayPreferences.CustomPrefs.home2 || '').selectmenu("refresh"); $('#selectHomeSection4', page).val(displayPreferences.CustomPrefs.home3 || '').selectmenu("refresh"); + $('#chkEnableLibraryTileNames', page).checked(displayPreferences.CustomPrefs.enableLibraryTileNames != '0').checkboxradio("refresh"); + Dashboard.hideLoadingMsg(); } @@ -37,6 +39,7 @@ displayPreferences.CustomPrefs.home1 = $('#selectHomeSection2', page).val(); displayPreferences.CustomPrefs.home2 = $('#selectHomeSection3', page).val(); displayPreferences.CustomPrefs.home3 = $('#selectHomeSection4', page).val(); + displayPreferences.CustomPrefs.enableLibraryTileNames = $('#chkEnableLibraryTileNames', page).checked() ? '1' : '0'; ApiClient.updateDisplayPreferences('home', displayPreferences, userId, 'webclient').done(function () {