From a25e5d7f9bdaf2df28fe4742084f4789b47f020b Mon Sep 17 00:00:00 2001 From: grafixeyehero Date: Tue, 21 Jan 2020 21:58:44 +0300 Subject: [PATCH 1/4] fix alphaPicker class --- src/controllers/movies/movies.js | 8 +++++--- src/controllers/movies/movietrailers.js | 8 +++++--- src/controllers/music/musicalbums.js | 8 +++++--- src/controllers/music/musicartists.js | 10 +++++++--- src/controllers/shows/tvshows.js | 10 +++++++--- src/movies.html | 8 ++++---- src/music.html | 12 ++++++------ src/tv.html | 4 ++-- 8 files changed, 41 insertions(+), 27 deletions(-) diff --git a/src/controllers/movies/movies.js b/src/controllers/movies/movies.js index 3a365acc90..fcf827016f 100644 --- a/src/controllers/movies/movies.js +++ b/src/controllers/movies/movies.js @@ -169,9 +169,11 @@ define(["loading", "layoutManager", "userSettings", "events", "libraryBrowser", valueChangeEvent: "click" }); - if (layoutManager.desktop || layoutManager.mobile) { - alphaPickerElement.classList.add("alphabetPicker-right"); - itemsContainer.classList.remove("padded-left-withalphapicker"); + if (layoutManager.tv) { + alphaPickerElement.classList.add("alphaPicker-fixed-left"); + itemsContainer.classList.add("padded-left-withalphapicker"); + } else { + alphaPickerElement.classList.add("alphaPicker-fixed-right"); itemsContainer.classList.add("padded-right-withalphapicker"); } } diff --git a/src/controllers/movies/movietrailers.js b/src/controllers/movies/movietrailers.js index 3e62298613..3f6a9d7d00 100644 --- a/src/controllers/movies/movietrailers.js +++ b/src/controllers/movies/movietrailers.js @@ -193,6 +193,7 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", " function initPage(tabContent) { var alphaPickerElement = tabContent.querySelector(".alphaPicker"); + var itemsContainer = tabContent.querySelector(".itemsContainer"); alphaPickerElement.addEventListener("alphavaluechanged", function (e) { var newValue = e.detail.value; var query = getQuery(tabContent); @@ -205,10 +206,11 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", " valueChangeEvent: "click" }); - if (layoutManager.desktop || layoutManager.mobile) { + if (layoutManager.tv) { + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-left"); + itemsContainer.classList.add("padded-left-withalphapicker"); + } else { tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); - var itemsContainer = tabContent.querySelector(".itemsContainer"); - itemsContainer.classList.remove("padded-left-withalphapicker"); itemsContainer.classList.add("padded-right-withalphapicker"); } diff --git a/src/controllers/music/musicalbums.js b/src/controllers/music/musicalbums.js index 480f0af77f..b5bb5eacab 100644 --- a/src/controllers/music/musicalbums.js +++ b/src/controllers/music/musicalbums.js @@ -199,6 +199,7 @@ define(["layoutManager", "playbackManager", "loading", "events", "libraryBrowser function initPage(tabContent) { var alphaPickerElement = tabContent.querySelector(".alphaPicker"); + var itemsContainer = tabContent.querySelector(".itemsContainer"); alphaPickerElement.addEventListener("alphavaluechanged", function (e) { var newValue = e.detail.value; @@ -211,10 +212,11 @@ define(["layoutManager", "playbackManager", "loading", "events", "libraryBrowser element: alphaPickerElement, valueChangeEvent: "click" }); - if (layoutManager.desktop || layoutManager.mobile) { + if (layoutManager.tv) { + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-left"); + itemsContainer.classList.add("padded-left-withalphapicker"); + } else { tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); - var itemsContainer = tabContent.querySelector(".itemsContainer"); - itemsContainer.classList.remove("padded-left-withalphapicker"); itemsContainer.classList.add("padded-right-withalphapicker"); } diff --git a/src/controllers/music/musicartists.js b/src/controllers/music/musicartists.js index aaeea8c885..01fdf7d563 100644 --- a/src/controllers/music/musicartists.js +++ b/src/controllers/music/musicartists.js @@ -181,6 +181,7 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", " function initPage(tabContent) { var alphaPickerElement = tabContent.querySelector(".alphaPicker"); + var itemsContainer = tabContent.querySelector(".itemsContainer"); alphaPickerElement.addEventListener("alphavaluechanged", function (e) { var newValue = e.detail.value; @@ -193,10 +194,13 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", " element: alphaPickerElement, valueChangeEvent: "click" }); - if (layoutManager.desktop || layoutManager.mobile) { + if (layoutManager.tv) { + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-left"); + alphaPickerElement.classList.add("alphaPicker-fixed-left"); + itemsContainer.classList.add("padded-left-withalphapicker"); + } else { tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); - var itemsContainer = tabContent.querySelector(".itemsContainer"); - itemsContainer.classList.remove("padded-left-withalphapicker"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); itemsContainer.classList.add("padded-right-withalphapicker"); } diff --git a/src/controllers/shows/tvshows.js b/src/controllers/shows/tvshows.js index 1dec530540..c37b3d8fbd 100644 --- a/src/controllers/shows/tvshows.js +++ b/src/controllers/shows/tvshows.js @@ -210,6 +210,7 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", " function initPage(tabContent) { var alphaPickerElement = tabContent.querySelector(".alphaPicker"); + var itemsContainer = tabContent.querySelector(".itemsContainer"); alphaPickerElement.addEventListener("alphavaluechanged", function (e) { var newValue = e.detail.value; @@ -222,10 +223,13 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", " element: alphaPickerElement, valueChangeEvent: "click" }); - if (layoutManager.desktop || layoutManager.mobile) { + if (layoutManager.tv) { + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-left"); + alphaPickerElement.classList.add("alphaPicker-fixed-left"); + itemsContainer.classList.add("padded-left-withalphapicker"); + } else { tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); - var itemsContainer = tabContent.querySelector(".itemsContainer"); - itemsContainer.classList.remove("padded-left-withalphapicker"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); itemsContainer.classList.add("padded-right-withalphapicker"); } diff --git a/src/movies.html b/src/movies.html index c211d9686a..ae5aaf5e73 100644 --- a/src/movies.html +++ b/src/movies.html @@ -8,10 +8,10 @@ -
+
-
+
@@ -53,7 +53,7 @@
-
+
@@ -90,4 +90,4 @@
-
\ No newline at end of file +
diff --git a/src/music.html b/src/music.html index e86f179208..6e860de01f 100644 --- a/src/music.html +++ b/src/music.html @@ -44,10 +44,10 @@
-
+
-
+
@@ -60,10 +60,10 @@
-
+
-
+
@@ -76,10 +76,10 @@
-
+
-
+
diff --git a/src/tv.html b/src/tv.html index 1327d53ffe..f097eba15d 100644 --- a/src/tv.html +++ b/src/tv.html @@ -8,8 +8,8 @@
-
-
+
+
From 4939f2fd60468e4716634a72fde3d43734b5d4d4 Mon Sep 17 00:00:00 2001 From: grafixeyehero Date: Tue, 21 Jan 2020 22:21:03 +0300 Subject: [PATCH 2/4] add alphaPicker-fixed left and right class --- src/controllers/movies/movietrailers.js | 2 ++ src/controllers/music/musicalbums.js | 3 +++ src/controllers/music/musicartists.js | 1 + 3 files changed, 6 insertions(+) diff --git a/src/controllers/movies/movietrailers.js b/src/controllers/movies/movietrailers.js index 3f6a9d7d00..33cfe628c1 100644 --- a/src/controllers/movies/movietrailers.js +++ b/src/controllers/movies/movietrailers.js @@ -208,9 +208,11 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", " if (layoutManager.tv) { tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-left"); + alphaPickerElement.classList.add("alphaPicker-fixed-left"); itemsContainer.classList.add("padded-left-withalphapicker"); } else { tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); itemsContainer.classList.add("padded-right-withalphapicker"); } diff --git a/src/controllers/music/musicalbums.js b/src/controllers/music/musicalbums.js index b5bb5eacab..d48f7466b7 100644 --- a/src/controllers/music/musicalbums.js +++ b/src/controllers/music/musicalbums.js @@ -212,11 +212,14 @@ define(["layoutManager", "playbackManager", "loading", "events", "libraryBrowser element: alphaPickerElement, valueChangeEvent: "click" }); + if (layoutManager.tv) { tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-left"); + alphaPickerElement.classList.add("alphaPicker-fixed-left"); itemsContainer.classList.add("padded-left-withalphapicker"); } else { tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); itemsContainer.classList.add("padded-right-withalphapicker"); } diff --git a/src/controllers/music/musicartists.js b/src/controllers/music/musicartists.js index 01fdf7d563..5e1a23dfe9 100644 --- a/src/controllers/music/musicartists.js +++ b/src/controllers/music/musicartists.js @@ -194,6 +194,7 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", " element: alphaPickerElement, valueChangeEvent: "click" }); + if (layoutManager.tv) { tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-left"); alphaPickerElement.classList.add("alphaPicker-fixed-left"); From f3426a97a1bfc8c0e1c0422573073cf890856ea0 Mon Sep 17 00:00:00 2001 From: grafixeyehero Date: Wed, 22 Jan 2020 19:42:43 +0300 Subject: [PATCH 3/4] remove alphabetPicker-left alphaPicker-fixed-left padded-left-withalphapicker class --- src/assets/css/librarybrowser.css | 4 ---- src/components/alphapicker/style.css | 8 -------- src/controllers/list.js | 20 ++++---------------- src/controllers/movies/movies.js | 9 ++------- src/controllers/movies/movietrailers.js | 12 +++--------- src/controllers/music/musicalbums.js | 12 +++--------- src/controllers/music/musicartists.js | 12 +++--------- src/controllers/shows/tvshows.js | 13 ++++--------- 8 files changed, 19 insertions(+), 71 deletions(-) diff --git a/src/assets/css/librarybrowser.css b/src/assets/css/librarybrowser.css index b9f406bc0d..2b53663f2a 100644 --- a/src/assets/css/librarybrowser.css +++ b/src/assets/css/librarybrowser.css @@ -895,10 +895,6 @@ div:not(.sectionTitleContainer-cards) > .sectionTitle-cards { } @media all and (min-height:31.25em) { - .padded-left-withalphapicker { - padding-left: 7.5%; - } - .padded-right-withalphapicker { padding-right: 7.5%; } diff --git a/src/components/alphapicker/style.css b/src/components/alphapicker/style.css index 29543421eb..90208d039f 100644 --- a/src/components/alphapicker/style.css +++ b/src/components/alphapicker/style.css @@ -112,20 +112,12 @@ bottom: 1%; } -.alphaPicker-fixed-left { - left: .4em; -} - .alphaPicker-fixed-right { right: .4em; } @media all and (min-width: 62.5em) { - .alphaPicker-fixed-left { - left: 1em; - } - .alphaPicker-fixed-right { right: 1em; } diff --git a/src/controllers/list.js b/src/controllers/list.js index a554bec611..f5d601345d 100644 --- a/src/controllers/list.js +++ b/src/controllers/list.js @@ -203,15 +203,9 @@ define(["globalize", "listView", "layoutManager", "userSettings", "focusManager" if ("SortName" === values.sortBy && "Ascending" === values.sortOrder && numItems > 40) { alphaPicker.classList.remove("hide"); - - if (layoutManager.tv) { - instance.itemsContainer.parentNode.classList.add("padded-left-withalphapicker"); - } else { - instance.itemsContainer.parentNode.classList.add("padded-right-withalphapicker"); - } + instance.itemsContainer.parentNode.classList.add("padded-right-withalphapicker"); } else { alphaPicker.classList.add("hide"); - instance.itemsContainer.parentNode.classList.remove("padded-left-withalphapicker"); instance.itemsContainer.parentNode.classList.remove("padded-right-withalphapicker"); } } @@ -540,15 +534,9 @@ define(["globalize", "listView", "layoutManager", "userSettings", "focusManager" self.scroller = view.querySelector(".scrollFrameY"); var alphaPickerElement = self.alphaPickerElement; - if (layoutManager.tv) { - alphaPickerElement.classList.add("alphaPicker-fixed-left"); - alphaPickerElement.classList.add("focuscontainer-left"); - self.itemsContainer.parentNode.classList.add("padded-left-withalphapicker"); - } else { - alphaPickerElement.classList.add("alphaPicker-fixed-right"); - alphaPickerElement.classList.add("focuscontainer-right"); - self.itemsContainer.parentNode.classList.add("padded-right-withalphapicker"); - } + alphaPickerElement.classList.add("alphaPicker-fixed-right"); + alphaPickerElement.classList.add("focuscontainer-right"); + self.itemsContainer.parentNode.classList.add("padded-right-withalphapicker"); self.alphaPicker = new alphaPicker({ element: alphaPickerElement, diff --git a/src/controllers/movies/movies.js b/src/controllers/movies/movies.js index fcf827016f..7ba467c1a4 100644 --- a/src/controllers/movies/movies.js +++ b/src/controllers/movies/movies.js @@ -169,13 +169,8 @@ define(["loading", "layoutManager", "userSettings", "events", "libraryBrowser", valueChangeEvent: "click" }); - if (layoutManager.tv) { - alphaPickerElement.classList.add("alphaPicker-fixed-left"); - itemsContainer.classList.add("padded-left-withalphapicker"); - } else { - alphaPickerElement.classList.add("alphaPicker-fixed-right"); - itemsContainer.classList.add("padded-right-withalphapicker"); - } + alphaPickerElement.classList.add("alphaPicker-fixed-right"); + itemsContainer.classList.add("padded-right-withalphapicker"); } var btnFilter = tabContent.querySelector(".btnFilter"); diff --git a/src/controllers/movies/movietrailers.js b/src/controllers/movies/movietrailers.js index 33cfe628c1..c764190ee0 100644 --- a/src/controllers/movies/movietrailers.js +++ b/src/controllers/movies/movietrailers.js @@ -206,15 +206,9 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", " valueChangeEvent: "click" }); - if (layoutManager.tv) { - tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-left"); - alphaPickerElement.classList.add("alphaPicker-fixed-left"); - itemsContainer.classList.add("padded-left-withalphapicker"); - } else { - tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); - alphaPickerElement.classList.add("alphaPicker-fixed-right"); - itemsContainer.classList.add("padded-right-withalphapicker"); - } + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); + itemsContainer.classList.add("padded-right-withalphapicker"); tabContent.querySelector(".btnFilter").addEventListener("click", function () { self.showFilterMenu(); diff --git a/src/controllers/music/musicalbums.js b/src/controllers/music/musicalbums.js index d48f7466b7..58d30e71da 100644 --- a/src/controllers/music/musicalbums.js +++ b/src/controllers/music/musicalbums.js @@ -213,15 +213,9 @@ define(["layoutManager", "playbackManager", "loading", "events", "libraryBrowser valueChangeEvent: "click" }); - if (layoutManager.tv) { - tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-left"); - alphaPickerElement.classList.add("alphaPicker-fixed-left"); - itemsContainer.classList.add("padded-left-withalphapicker"); - } else { - tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); - alphaPickerElement.classList.add("alphaPicker-fixed-right"); - itemsContainer.classList.add("padded-right-withalphapicker"); - } + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); + itemsContainer.classList.add("padded-right-withalphapicker"); tabContent.querySelector(".btnFilter").addEventListener("click", function () { self.showFilterMenu(); diff --git a/src/controllers/music/musicartists.js b/src/controllers/music/musicartists.js index 5e1a23dfe9..ceed448a06 100644 --- a/src/controllers/music/musicartists.js +++ b/src/controllers/music/musicartists.js @@ -195,15 +195,9 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", " valueChangeEvent: "click" }); - if (layoutManager.tv) { - tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-left"); - alphaPickerElement.classList.add("alphaPicker-fixed-left"); - itemsContainer.classList.add("padded-left-withalphapicker"); - } else { - tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); - alphaPickerElement.classList.add("alphaPicker-fixed-right"); - itemsContainer.classList.add("padded-right-withalphapicker"); - } + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); + itemsContainer.classList.add("padded-right-withalphapicker"); tabContent.querySelector(".btnFilter").addEventListener("click", function () { self.showFilterMenu(); diff --git a/src/controllers/shows/tvshows.js b/src/controllers/shows/tvshows.js index c37b3d8fbd..24f6cb1a03 100644 --- a/src/controllers/shows/tvshows.js +++ b/src/controllers/shows/tvshows.js @@ -223,15 +223,10 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", " element: alphaPickerElement, valueChangeEvent: "click" }); - if (layoutManager.tv) { - tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-left"); - alphaPickerElement.classList.add("alphaPicker-fixed-left"); - itemsContainer.classList.add("padded-left-withalphapicker"); - } else { - tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); - alphaPickerElement.classList.add("alphaPicker-fixed-right"); - itemsContainer.classList.add("padded-right-withalphapicker"); - } + + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); + itemsContainer.classList.add("padded-right-withalphapicker"); tabContent.querySelector(".btnFilter").addEventListener("click", function () { self.showFilterMenu(); From a9ca46b6d841e546a7757e13ae939a6095f17fb1 Mon Sep 17 00:00:00 2001 From: grafixeyehero Date: Sun, 26 Jan 2020 00:20:01 +0300 Subject: [PATCH 4/4] apply suggustiion --- src/controllers/movies/movies.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controllers/movies/movies.js b/src/controllers/movies/movies.js index 7ba467c1a4..ce077bd179 100644 --- a/src/controllers/movies/movies.js +++ b/src/controllers/movies/movies.js @@ -169,6 +169,7 @@ define(["loading", "layoutManager", "userSettings", "events", "libraryBrowser", valueChangeEvent: "click" }); + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); alphaPickerElement.classList.add("alphaPicker-fixed-right"); itemsContainer.classList.add("padded-right-withalphapicker"); }