Skip to content

Commit

Permalink
Removed inline styling and fixed eslint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony de Jong <11158888+anthony-de-jong@users.noreply.github.com>
  • Loading branch information
anthony-de-jong committed May 31, 2022
1 parent db8690e commit 7ff9a6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion groups-domains.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<div class="form-group">
<label for="new_domain">Domain:</label>
<input id="new_domain" type="url" class="form-control active" placeholder="Domain to be added" autocomplete="off" spellcheck="false" autocapitalize="none" autocorrect="off">
<div id="suggest_domains" style="display: none; overflow-x: auto;"></div>
<div id="suggest_domains" class="table-responsive no-border"></div>
</div>
</div>
<div class="col-md-6 form-group">
Expand Down
8 changes: 5 additions & 3 deletions scripts/pi-hole/js/groups-domains.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,17 @@ function showSuggestDomains(event) {
return;
}

// URL is not supported in IE11, but we are in a try-block so we can ignore it
// eslint-disable-next-line compat/compat
var parts = new URL(clipboardData).hostname.split(".");
var table = $('<table style="text-align: right !important">');
var table = $("<table>");

for (var i = 0; i < parts.length - 1; ++i) {
var hostname = parts.slice(i).join(".");

table.append(
$("<tr>")
.append($('<td class="text-nowrap">').text(i === 0 ? "Did you mean" : "or"))
.append($('<td class="text-nowrap text-right">').text(i === 0 ? "Did you mean" : "or"))
.append($("<td>").append(createButton(hostname)))
);
}
Expand All @@ -108,7 +110,7 @@ function showSuggestDomains(event) {
newDomainEl.one("input", hideSuggestDomains);
});
});
} catch (ex) {
} catch {
hideSuggestDomains();
}
});
Expand Down

0 comments on commit 7ff9a6d

Please sign in to comment.