mirror of
https://github.com/linuxserver/Heimdall.git
synced 2026-02-21 12:10:34 +09:00
Fix lint issues
This commit is contained in:
26
public/js/app.js
vendored
26
public/js/app.js
vendored
@@ -4120,20 +4120,20 @@ $.when($.ready).then(function () {
|
||||
var width = $input.outerWidth();
|
||||
var $autocomplete = $('<div id="search-autocomplete"></div>');
|
||||
suggestions.forEach(function (suggestion) {
|
||||
var $item = $('<div class="autocomplete-item"></div>').text(suggestion).on('click', function () {
|
||||
var $item = $('<div class="autocomplete-item"></div>').text(suggestion).on("click", function () {
|
||||
$input.val(suggestion);
|
||||
hideAutocomplete();
|
||||
$input.closest('form').submit();
|
||||
$input.closest("form").submit();
|
||||
});
|
||||
$autocomplete.append($item);
|
||||
});
|
||||
$autocomplete.css({
|
||||
position: 'absolute',
|
||||
top: position.top + $input.outerHeight() + 'px',
|
||||
left: position.left + 'px',
|
||||
width: width + 'px'
|
||||
position: "absolute",
|
||||
top: "".concat(position.top + $input.outerHeight(), "px"),
|
||||
left: "".concat(position.left, "px"),
|
||||
width: "".concat(width, "px")
|
||||
});
|
||||
$input.closest('#search-container').append($autocomplete);
|
||||
$input.closest("#search-container").append($autocomplete);
|
||||
}
|
||||
function fetchAutocomplete(query, provider) {
|
||||
// Cancel previous request if any
|
||||
@@ -4145,8 +4145,8 @@ $.when($.ready).then(function () {
|
||||
return;
|
||||
}
|
||||
currentAutocompleteRequest = $.ajax({
|
||||
url: base + 'search/autocomplete',
|
||||
method: 'GET',
|
||||
url: "".concat(base, "search/autocomplete"),
|
||||
method: "GET",
|
||||
data: {
|
||||
q: query,
|
||||
provider: provider
|
||||
@@ -4209,15 +4209,15 @@ $.when($.ready).then(function () {
|
||||
});
|
||||
|
||||
// Hide autocomplete when clicking outside
|
||||
$(document).on('click', function (e) {
|
||||
if (!$(e.target).closest('#search-container').length) {
|
||||
$(document).on("click", function (e) {
|
||||
if (!$(e.target).closest("#search-container").length) {
|
||||
hideAutocomplete();
|
||||
}
|
||||
});
|
||||
|
||||
// Hide autocomplete on Escape key
|
||||
$(document).on('keydown', function (e) {
|
||||
if (e.key === 'Escape') {
|
||||
$(document).on("keydown", function (e) {
|
||||
if (e.key === "Escape") {
|
||||
hideAutocomplete();
|
||||
}
|
||||
});
|
||||
|
||||
2
public/mix-manifest.json
generated
2
public/mix-manifest.json
generated
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"/css/app.css": "/css/app.css?id=18678c7bd2dc9b9f1d75e1aff3b7ea8e",
|
||||
"/js/app.js": "/js/app.js?id=43116113f2c9194304ab84d8205fc7f9"
|
||||
"/js/app.js": "/js/app.js?id=427b8a731c1bc78d363961ff85a33ee3"
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ $.when($.ready).then(() => {
|
||||
|
||||
function showAutocomplete(suggestions, inputElement) {
|
||||
hideAutocomplete();
|
||||
|
||||
|
||||
if (!suggestions || suggestions.length === 0) {
|
||||
return;
|
||||
}
|
||||
@@ -128,26 +128,26 @@ $.when($.ready).then(() => {
|
||||
const width = $input.outerWidth();
|
||||
|
||||
const $autocomplete = $('<div id="search-autocomplete"></div>');
|
||||
|
||||
|
||||
suggestions.forEach((suggestion) => {
|
||||
const $item = $('<div class="autocomplete-item"></div>')
|
||||
.text(suggestion)
|
||||
.on('click', function() {
|
||||
.on("click", () => {
|
||||
$input.val(suggestion);
|
||||
hideAutocomplete();
|
||||
$input.closest('form').submit();
|
||||
$input.closest("form").submit();
|
||||
});
|
||||
$autocomplete.append($item);
|
||||
});
|
||||
|
||||
$autocomplete.css({
|
||||
position: 'absolute',
|
||||
top: position.top + $input.outerHeight() + 'px',
|
||||
left: position.left + 'px',
|
||||
width: width + 'px'
|
||||
position: "absolute",
|
||||
top: `${position.top + $input.outerHeight()}px`,
|
||||
left: `${position.left}px`,
|
||||
width: `${width}px`,
|
||||
});
|
||||
|
||||
$input.closest('#search-container').append($autocomplete);
|
||||
$input.closest("#search-container").append($autocomplete);
|
||||
}
|
||||
|
||||
function fetchAutocomplete(query, provider) {
|
||||
@@ -162,22 +162,22 @@ $.when($.ready).then(() => {
|
||||
}
|
||||
|
||||
currentAutocompleteRequest = $.ajax({
|
||||
url: base + 'search/autocomplete',
|
||||
method: 'GET',
|
||||
url: `${base}search/autocomplete`,
|
||||
method: "GET",
|
||||
data: {
|
||||
q: query,
|
||||
provider: provider
|
||||
provider,
|
||||
},
|
||||
success: function(data) {
|
||||
success(data) {
|
||||
const inputElement = $("#search-container input[name=q]")[0];
|
||||
showAutocomplete(data, inputElement);
|
||||
},
|
||||
error: function() {
|
||||
error() {
|
||||
hideAutocomplete();
|
||||
},
|
||||
complete: function() {
|
||||
complete() {
|
||||
currentAutocompleteRequest = null;
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ $.when($.ready).then(() => {
|
||||
const search = this.value;
|
||||
const items = $("#sortable").find(".item-container");
|
||||
const provider = $("#search-container select[name=provider]").val();
|
||||
|
||||
|
||||
if (provider === "tiles") {
|
||||
hideAutocomplete();
|
||||
if (search.length > 0) {
|
||||
@@ -202,7 +202,7 @@ $.when($.ready).then(() => {
|
||||
}
|
||||
} else {
|
||||
items.show();
|
||||
|
||||
|
||||
// Debounce autocomplete requests
|
||||
clearTimeout(autocompleteTimeout);
|
||||
autocompleteTimeout = setTimeout(() => {
|
||||
@@ -234,15 +234,15 @@ $.when($.ready).then(() => {
|
||||
});
|
||||
|
||||
// Hide autocomplete when clicking outside
|
||||
$(document).on('click', function(e) {
|
||||
if (!$(e.target).closest('#search-container').length) {
|
||||
$(document).on("click", (e) => {
|
||||
if (!$(e.target).closest("#search-container").length) {
|
||||
hideAutocomplete();
|
||||
}
|
||||
});
|
||||
|
||||
// Hide autocomplete on Escape key
|
||||
$(document).on('keydown', function(e) {
|
||||
if (e.key === 'Escape') {
|
||||
$(document).on("keydown", (e) => {
|
||||
if (e.key === "Escape") {
|
||||
hideAutocomplete();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user