mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
fix formatting in moviecollections/movies.js
This commit is contained in:
parent
5ef8a2e1cc
commit
92aa36de0b
@ -4,20 +4,25 @@ define(["loading", "events", "libraryBrowser", "imageLoader", "listView", "cardB
|
|||||||
function getPageData(context) {
|
function getPageData(context) {
|
||||||
var key = getSavedQueryKey(context),
|
var key = getSavedQueryKey(context),
|
||||||
pageData = data[key];
|
pageData = data[key];
|
||||||
return pageData || (pageData = data[key] = {
|
if (!pageData) {
|
||||||
query: {
|
pageData = data[key] = {
|
||||||
SortBy: "SortName",
|
query: {
|
||||||
SortOrder: "Ascending",
|
SortBy: "SortName",
|
||||||
IncludeItemTypes: "BoxSet",
|
SortOrder: "Ascending",
|
||||||
Recursive: !0,
|
IncludeItemTypes: "BoxSet",
|
||||||
Fields: "PrimaryImageAspectRatio,SortName",
|
Recursive: true,
|
||||||
ImageTypeLimit: 1,
|
Fields: "PrimaryImageAspectRatio,SortName",
|
||||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb",
|
ImageTypeLimit: 1,
|
||||||
StartIndex: 0,
|
EnableImageTypes: "Primary,Backdrop,Banner,Thumb",
|
||||||
Limit: pageSize
|
StartIndex: 0,
|
||||||
},
|
Limit: pageSize
|
||||||
view: libraryBrowser.getSavedView(key) || "Poster"
|
},
|
||||||
}, pageData.query.ParentId = params.topParentId, libraryBrowser.loadSavedQueryValues(key, pageData.query)), pageData
|
view: libraryBrowser.getSavedView(key) || "Poster"
|
||||||
|
};
|
||||||
|
pageData.query.ParentId = params.topParentId;
|
||||||
|
libraryBrowser.loadSavedQueryValues(key, pageData.query);
|
||||||
|
}
|
||||||
|
return pageData;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getQuery(context) {
|
function getQuery(context) {
|
||||||
|
@ -3,7 +3,14 @@ define(["loading", "layoutManager", "userSettings", "events", "libraryBrowser",
|
|||||||
"use strict";
|
"use strict";
|
||||||
return function(view, params, tabContent, options) {
|
return function(view, params, tabContent, options) {
|
||||||
function onViewStyleChange() {
|
function onViewStyleChange() {
|
||||||
"List" == self.getCurrentViewStyle() ? (itemsContainer.classList.add("vertical-list"), itemsContainer.classList.remove("vertical-wrap")) : (itemsContainer.classList.remove("vertical-list"), itemsContainer.classList.add("vertical-wrap")), itemsContainer.innerHTML = ""
|
if (self.getCurrentViewStyle() == "List") {
|
||||||
|
itemsContainer.classList.add("vertical-list");
|
||||||
|
itemsContainer.classList.remove("vertical-wrap");
|
||||||
|
} else {
|
||||||
|
itemsContainer.classList.remove("vertical-list");
|
||||||
|
itemsContainer.classList.add("vertical-wrap");
|
||||||
|
}
|
||||||
|
itemsContainer.innerHTML = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateFilterControls() {
|
function updateFilterControls() {
|
||||||
@ -101,15 +108,27 @@ define(["loading", "layoutManager", "userSettings", "events", "libraryBrowser",
|
|||||||
}
|
}
|
||||||
|
|
||||||
function initPage(tabContent) {
|
function initPage(tabContent) {
|
||||||
itemsContainer.fetchData = fetchData, itemsContainer.getItemsHtml = getItemsHtml, itemsContainer.afterRefresh = afterRefresh;
|
itemsContainer.fetchData = fetchData;
|
||||||
|
itemsContainer.getItemsHtml = getItemsHtml;
|
||||||
|
itemsContainer.afterRefresh = afterRefresh;
|
||||||
var alphaPickerElement = tabContent.querySelector(".alphaPicker");
|
var alphaPickerElement = tabContent.querySelector(".alphaPicker");
|
||||||
alphaPickerElement && (alphaPickerElement.addEventListener("alphavaluechanged", function(e) {
|
if (alphaPickerElement) {
|
||||||
var newValue = e.detail.value;
|
alphaPickerElement.addEventListener("alphavaluechanged", function(e) {
|
||||||
query.NameStartsWithOrGreater = newValue, query.StartIndex = 0, itemsContainer.refreshItems()
|
var newValue = e.detail.value;
|
||||||
}), self.alphaPicker = new alphaPicker({
|
query.NameStartsWithOrGreater = newValue;
|
||||||
element: alphaPickerElement,
|
query.StartIndex = 0;
|
||||||
valueChangeEvent: "click"
|
itemsContainer.refreshItems();
|
||||||
}), (layoutManager.desktop || layoutManager.mobile) && (alphaPickerElement.classList.add("alphabetPicker-right"), itemsContainer.classList.remove("padded-left-withalphapicker"), itemsContainer.classList.add("padded-right-withalphapicker")));
|
});
|
||||||
|
self.alphaPicker = new alphaPicker({
|
||||||
|
element: alphaPickerElement,
|
||||||
|
valueChangeEvent: "click"
|
||||||
|
});
|
||||||
|
if (layoutManager.desktop || layoutManager.mobile) {
|
||||||
|
alphaPickerElement.classList.add("alphabetPicker-right");
|
||||||
|
itemsContainer.classList.remove("padded-left-withalphapicker");
|
||||||
|
itemsContainer.classList.add("padded-right-withalphapicker");
|
||||||
|
}
|
||||||
|
}
|
||||||
var btnFilter = tabContent.querySelector(".btnFilter");
|
var btnFilter = tabContent.querySelector(".btnFilter");
|
||||||
btnFilter && btnFilter.addEventListener("click", function() {
|
btnFilter && btnFilter.addEventListener("click", function() {
|
||||||
self.showFilterMenu()
|
self.showFilterMenu()
|
||||||
@ -157,7 +176,10 @@ define(["loading", "layoutManager", "userSettings", "events", "libraryBrowser",
|
|||||||
libraryBrowser.showLayoutMenu(e.target, self.getCurrentViewStyle(), "Banner,List,Poster,PosterCard,Thumb,ThumbCard".split(","))
|
libraryBrowser.showLayoutMenu(e.target, self.getCurrentViewStyle(), "Banner,List,Poster,PosterCard,Thumb,ThumbCard".split(","))
|
||||||
}), btnSelectView.addEventListener("layoutchange", function(e) {
|
}), btnSelectView.addEventListener("layoutchange", function(e) {
|
||||||
var viewStyle = e.detail.viewStyle;
|
var viewStyle = e.detail.viewStyle;
|
||||||
userSettings.set(savedViewKey, viewStyle), query.StartIndex = 0, onViewStyleChange(), itemsContainer.refreshItems()
|
userSettings.set(savedViewKey, viewStyle);
|
||||||
|
query.StartIndex = 0;
|
||||||
|
onViewStyleChange();
|
||||||
|
itemsContainer.refreshItems();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
var self = this,
|
var self = this,
|
||||||
@ -190,13 +212,19 @@ define(["loading", "layoutManager", "userSettings", "events", "libraryBrowser",
|
|||||||
query.StartIndex = 0, itemsContainer.refreshItems()
|
query.StartIndex = 0, itemsContainer.refreshItems()
|
||||||
}), filterDialog.show()
|
}), filterDialog.show()
|
||||||
})
|
})
|
||||||
}, self.getCurrentViewStyle = function() {
|
};
|
||||||
|
self.getCurrentViewStyle = function() {
|
||||||
return userSettings.get(savedViewKey) || "Poster"
|
return userSettings.get(savedViewKey) || "Poster"
|
||||||
}, self.initTab = function() {
|
};
|
||||||
initPage(tabContent), onViewStyleChange()
|
self.initTab = function() {
|
||||||
}, self.renderTab = function() {
|
initPage(tabContent);
|
||||||
itemsContainer.refreshItems(), updateFilterControls()
|
onViewStyleChange();
|
||||||
}, self.destroy = function() {
|
};
|
||||||
|
self.renderTab = function() {
|
||||||
|
itemsContainer.refreshItems();
|
||||||
|
updateFilterControls();
|
||||||
|
};
|
||||||
|
self.destroy = function() {
|
||||||
itemsContainer = null
|
itemsContainer = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user