Skip to content

Commit

Permalink
[Search] ID and class: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dreaming-augustin committed Dec 23, 2024
1 parent 6b67851 commit d73fef1
Showing 1 changed file with 26 additions and 38 deletions.
64 changes: 26 additions & 38 deletions src/definitions/modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -1537,21 +1537,17 @@
// each item inside category
html += '<div class="results">';
$.each(category.results, function (index, result) {
if (result[fields.url]) {
html += '<a href="' + result[fields.url].replace(/"/g, '') + '" ';
} else {
html += '<div ';
}
html += result[fields.url]
? '<a href="' + result[fields.url].replace(/"/g, '') + '" '
: html += '<div ';

if (result[fields.id] !== undefined) {
html += ' id="' + result[fields.id] + '" ';
}
html += result[fields.id] !== undefined
? ' id="' + result[fields.id] + '" '
: '';

if (result[fields.classes] !== undefined) {
html += ' class="result ' + result[fields.classes] + '">';
} else {
html += ' class="result">';
}
html += result[fields.classes] !== undefined
? ' class="result ' + result[fields.classes] + '">'
: ' class="result">';

if (result[fields.image] !== undefined) {
html += ''
Expand All @@ -1572,11 +1568,9 @@
html += ''
+ '</div>';

if (result[fields.url]) {
html += '</a>';
} else {
html += '</div>';
}
html += result[fields.url]
? '</a>'
: '</div>';

Check failure on line 1573 in src/definitions/modules/search.js

View workflow job for this annotation

GitHub Actions / Lint

Block must not be padded by blank lines

});
html += '</div>';
Expand Down Expand Up @@ -1609,21 +1603,17 @@
if (response[fields.results] !== undefined) {
// each result
$.each(response[fields.results], function (index, result) {
if (result[fields.url]) {
html += '<a href="' + result[fields.url].replace(/"/g, '') + '" ';
} else {
html += '<div ';
}

if (result[fields.id] !== undefined) {
html += ' id="' + result[fields.id] + '" ';
}

if (result[fields.classes] !== undefined) {
html += ' class="result ' + result[fields.classes] + '">';
} else {
html += ' class="result">';
}
html += result[fields.url]
? '<a href="' + result[fields.url].replace(/"/g, '') + '" '
: '<div ';

html += result[fields.id] !== undefined
? ' id="' + result[fields.id] + '" '
: '';

html += result[fields.classes] !== undefined
? ' class="result ' + result[fields.classes] + '">'
: ' class="result">';

if (result[fields.image] !== undefined) {
html += ''
Expand All @@ -1644,11 +1634,9 @@
html += ''
+ '</div>';

if (result[fields.url]) {
html += '</a>';
} else {
html += '</div>';
}
html += result[fields.url]
? '</a>'
: '</div>';
});
if (response[fields.action]) {
html += fields.actionURL === false
Expand Down

0 comments on commit d73fef1

Please sign in to comment.