mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Disallow block padding
This commit is contained in:
parent
454b81a037
commit
5e1b6acffe
126 changed files with 2 additions and 2127 deletions
|
@ -11,7 +11,6 @@ import 'css!./searchfields';
|
|||
/* eslint-disable indent */
|
||||
|
||||
function onSearchTimeout() {
|
||||
|
||||
const instance = this;
|
||||
let value = instance.nextSearchValue;
|
||||
|
||||
|
@ -20,7 +19,6 @@ import 'css!./searchfields';
|
|||
}
|
||||
|
||||
function triggerSearch(instance, value) {
|
||||
|
||||
if (instance.searchTimeout) {
|
||||
clearTimeout(instance.searchTimeout);
|
||||
}
|
||||
|
@ -30,17 +28,14 @@ import 'css!./searchfields';
|
|||
}
|
||||
|
||||
function onAlphaValueClicked(e) {
|
||||
|
||||
const value = e.detail.value;
|
||||
const searchFieldsInstance = this;
|
||||
|
||||
const txtSearch = searchFieldsInstance.options.element.querySelector('.searchfields-txtSearch');
|
||||
|
||||
if (value === 'backspace') {
|
||||
|
||||
const val = txtSearch.value;
|
||||
txtSearch.value = val.length ? val.substring(0, val.length - 1) : '';
|
||||
|
||||
} else {
|
||||
txtSearch.value += value;
|
||||
}
|
||||
|
@ -51,7 +46,6 @@ import 'css!./searchfields';
|
|||
}
|
||||
|
||||
function initAlphaPicker(alphaPickerElement, instance) {
|
||||
|
||||
instance.alphaPicker = new AlphaPicker({
|
||||
element: alphaPickerElement,
|
||||
mode: 'keyboard'
|
||||
|
@ -61,16 +55,13 @@ import 'css!./searchfields';
|
|||
}
|
||||
|
||||
function onSearchInput(e) {
|
||||
|
||||
const value = e.target.value;
|
||||
const searchFieldsInstance = this;
|
||||
triggerSearch(searchFieldsInstance, value);
|
||||
}
|
||||
|
||||
function embed(elem, instance, options) {
|
||||
|
||||
import('text!./searchfields.template.html').then(({default: template}) => {
|
||||
|
||||
let html = globalize.translateHtml(template, 'core');
|
||||
|
||||
if (browser.tizen || browser.orsay) {
|
||||
|
@ -98,16 +89,13 @@ import 'css!./searchfields';
|
|||
|
||||
class SearchFields {
|
||||
constructor(options) {
|
||||
|
||||
this.options = options;
|
||||
embed(options.element, this, options);
|
||||
}
|
||||
focus() {
|
||||
|
||||
this.options.element.querySelector('.searchfields-txtSearch').focus();
|
||||
}
|
||||
destroy() {
|
||||
|
||||
const options = this.options;
|
||||
if (options) {
|
||||
options.element.classList.remove('searchFields');
|
||||
|
|
|
@ -10,7 +10,6 @@ import 'emby-button';
|
|||
/* eslint-disable indent */
|
||||
|
||||
function loadSuggestions(instance, context, apiClient) {
|
||||
|
||||
const options = {
|
||||
|
||||
SortBy: 'IsFavoriteOrLiked,Random',
|
||||
|
@ -24,20 +23,17 @@ import 'emby-button';
|
|||
};
|
||||
|
||||
apiClient.getItems(apiClient.getCurrentUserId(), options).then(function (result) {
|
||||
|
||||
if (instance.mode !== 'suggestions') {
|
||||
result.Items = [];
|
||||
}
|
||||
|
||||
const html = result.Items.map(function (i) {
|
||||
|
||||
const href = appRouter.getRouteUrl(i);
|
||||
|
||||
let itemHtml = '<div><a is="emby-linkbutton" class="button-link" style="display:inline-block;padding:.5em 1em;" href="' + href + '">';
|
||||
itemHtml += i.Name;
|
||||
itemHtml += '</a></div>';
|
||||
return itemHtml;
|
||||
|
||||
}).join('');
|
||||
|
||||
const searchSuggestions = context.querySelector('.searchSuggestions');
|
||||
|
@ -50,7 +46,6 @@ import 'emby-button';
|
|||
}
|
||||
|
||||
function getSearchHints(instance, apiClient, query) {
|
||||
|
||||
if (!query.searchTerm) {
|
||||
return Promise.resolve({
|
||||
SearchHints: []
|
||||
|
@ -129,7 +124,6 @@ import 'emby-button';
|
|||
|
||||
// Convert the search hint query to a regular item query
|
||||
if (apiClient.isMinServerVersion('3.4.1.31')) {
|
||||
|
||||
query.Fields = 'PrimaryImageAspectRatio,CanDelete,BasicSyncInfo,MediaSourceCount';
|
||||
query.Recursive = true;
|
||||
query.EnableTotalRecordCount = false;
|
||||
|
@ -140,7 +134,6 @@ import 'emby-button';
|
|||
if (!query.IncludeMedia) {
|
||||
if (query.IncludePeople) {
|
||||
methodName = 'getPeople';
|
||||
|
||||
} else if (query.IncludeArtists) {
|
||||
methodName = 'getArtists';
|
||||
}
|
||||
|
@ -155,7 +148,6 @@ import 'emby-button';
|
|||
}
|
||||
|
||||
function search(instance, apiClient, context, value) {
|
||||
|
||||
if (value || layoutManager.tv) {
|
||||
instance.mode = 'search';
|
||||
context.querySelector('.searchSuggestions').classList.add('hide');
|
||||
|
@ -165,7 +157,6 @@ import 'emby-button';
|
|||
}
|
||||
|
||||
if (instance.options.collectionType === 'livetv') {
|
||||
|
||||
searchType(instance, apiClient, {
|
||||
searchTerm: value,
|
||||
IncludePeople: false,
|
||||
|
@ -194,7 +185,6 @@ import 'emby-button';
|
|||
showChannelName: true
|
||||
});
|
||||
} else {
|
||||
|
||||
searchType(instance, apiClient, {
|
||||
searchTerm: value,
|
||||
IncludePeople: false,
|
||||
|
@ -231,7 +221,6 @@ import 'emby-button';
|
|||
});
|
||||
|
||||
if (instance.options.collectionType === 'livetv') {
|
||||
|
||||
searchType(instance, apiClient, {
|
||||
searchTerm: value,
|
||||
IncludePeople: false,
|
||||
|
@ -260,9 +249,7 @@ import 'emby-button';
|
|||
showAirDateTime: true,
|
||||
showChannelName: true
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
searchType(instance, apiClient, {
|
||||
searchTerm: value,
|
||||
IncludePeople: false,
|
||||
|
@ -560,18 +547,15 @@ import 'emby-button';
|
|||
}
|
||||
|
||||
function searchType(instance, apiClient, query, context, section, cardOptions) {
|
||||
|
||||
query.Limit = enableScrollX() ? 24 : 16;
|
||||
query.ParentId = instance.options.parentId;
|
||||
|
||||
getSearchHints(instance, apiClient, query).then(function (result) {
|
||||
|
||||
populateResults(result, context, section, cardOptions);
|
||||
});
|
||||
}
|
||||
|
||||
function populateResults(result, context, section, cardOptions) {
|
||||
|
||||
section = context.querySelector(section);
|
||||
|
||||
const items = result.Items || result.SearchHints;
|
||||
|
@ -601,9 +585,7 @@ import 'emby-button';
|
|||
}
|
||||
|
||||
function embed(elem, instance, options) {
|
||||
|
||||
import('text!./searchresults.template.html').then(({default: template}) => {
|
||||
|
||||
if (!enableScrollX()) {
|
||||
template = replaceAll(template, 'data-horizontal="true"', 'data-horizontal="false"');
|
||||
template = replaceAll(template, 'itemsContainer scrollSlider', 'itemsContainer scrollSlider vertical-wrap');
|
||||
|
@ -620,24 +602,20 @@ import 'emby-button';
|
|||
|
||||
class SearchResults {
|
||||
constructor(options) {
|
||||
|
||||
this.options = options;
|
||||
embed(options.element, this, options);
|
||||
}
|
||||
search(value) {
|
||||
|
||||
const apiClient = connectionManager.getApiClient(this.options.serverId);
|
||||
|
||||
search(this, apiClient, this.options.element, value);
|
||||
}
|
||||
destroy() {
|
||||
|
||||
const options = this.options;
|
||||
if (options) {
|
||||
options.element.classList.remove('searchFields');
|
||||
}
|
||||
this.options = null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue