Skip to content

Commit

Permalink
Merge pull request #794 from SSWConsulting/tooltip-icon
Browse files Browse the repository at this point in the history
Add info icon to tooltips
  • Loading branch information
tombui99 authored Nov 28, 2023
2 parents cfa8b06 + 5c6ec6c commit 8cba888
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import Icon from "../misccomponents/Icon.svelte";
import { htmlHintRules, customHtmlHintRules } from "../../../../docker/rules.js";
import LoadingCircle from "../misccomponents/LoadingCircle.svelte";
import { tooltip } from '../misccomponents/tooltip';
export let errors = [];
export let codeIssues = [];
Expand Down Expand Up @@ -136,7 +137,7 @@
<tr>
<th class="w-2/12 px-4 py-2">Page ({error.pages.length})</th>
<th class="w-9/12 px-4 py-2">Locations (line:col)</th>
<th class="w-1/12 px-4 py-2">Ignore</th>
<th class="w-1/12 px-4 py-2" title="Ignore URL for this rule in future scans" use:tooltip>Ignore</th>
</tr>
</thead>
<tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { createEventDispatcher } from "svelte";
import Icon from "../misccomponents/Icon.svelte";
import LoadingCircle from "../misccomponents/LoadingCircle.svelte";
import { tooltip } from '../misccomponents/tooltip';
export let errors = [];
export let codeIssues = [];
Expand Down Expand Up @@ -115,7 +116,7 @@
Issues ({Object.keys(url.errors).length})
</th>
<th class="w-9/12 px-4 py-2">Locations</th>
<th class="w-1/12 px-4 py-2">Ignore</th>
<th class="w-1/12 px-4 py-2" title="Ignore rule on this URL in future scans" use:tooltip>Ignore</th>
</tr>
</thead>
<tbody>
Expand Down
31 changes: 16 additions & 15 deletions ui/src/components/misccomponents/TooltipFromAction.svelte
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<script>
export let title;
export let x;
export let y;
export let title;
export let x;
export let y;
</script>
<div style="
top: {y + 5}px;
left: {x + 5}px;">{title}</div>

<div style="top: {y + 5}px; left: {x + 5}px;">
<i class="fa-solid fa-circle-info text-blue-600"></i> {title}
</div>

<style>
div {
border: 1px solid #ddd;
box-shadow: 1px 1px 1px #ddd;
background: white;
border-radius: 4px;
padding: 4px;
position: absolute;
}
</style>
div {
border: 1px solid #ddd;
box-shadow: 1px 1px 1px #ddd;
background: white;
border-radius: 4px;
padding: 4px;
position: absolute;
}
</style>

0 comments on commit 8cba888

Please sign in to comment.