Skip to content

Commit c95f8aa

Browse files
committed
fix(ui): adjust tooltip position
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent c7be929 commit c95f8aa

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

vulnerabilities/templates/weakness_curation.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@
159159
}
160160

161161
.has-tooltip-top::before {
162-
left: 0 !important;
163-
transform: translateY(-4.3rem) !important;
162+
transform: translate(-5% , -100%) !important;
164163
}
165164

166165
</style>

vulnerablecode/static/js/weakness_curation.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ const app = {
175175
createRow(v, item) {
176176
const tr = document.createElement('tr');
177177
const cwe_info = item.cwe_details[v]
178-
const isLastItem = item.all_cwes[item.all_cwes.length - 1] === v;
179-
const tooltipPosition = isLastItem ? "has-tooltip-top" : "has-tooltip-right";
180178
const state = this.userStates[this.currentIndex][v];
181179
tr.innerHTML = `
182180
<td
@@ -186,7 +184,7 @@ const app = {
186184
CWE-${v}<br>
187185
<span class="has-text-weight-normal">${cwe_info.name}</span>
188186
<span
189-
class="icon has-tooltip-multiline ${tooltipPosition} has-tooltip-arrow has-text-weight-normal"
187+
class="icon has-tooltip-multiline has-tooltip-top has-tooltip-arrow has-text-weight-normal"
190188
data-tooltip="${cwe_info.description}"
191189
>
192190
<i class="fa fa-info-circle"></i>
@@ -295,7 +293,7 @@ const app = {
295293
cycleState(v) {
296294
const seq = ['applicable', 'not-applicable'];
297295
const current = this.userStates[this.currentIndex][v];
298-
this.userStates[this.currentIndex][v] = seq[(seq.indexOf(current) + 1) % 2];
296+
this.userStates[this.currentIndex][v] = seq[(seq.indexOf(current) + 1) % seq.length];
299297
const item = curationItems[this.currentIndex];
300298
const weaknesses = item.all_cwes;
301299
this.renderBody(item, weaknesses);

0 commit comments

Comments
 (0)