Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed tag pointer #10629

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions css/80_app.css
Original file line number Diff line number Diff line change
Expand Up @@ -2663,6 +2663,9 @@ button.raw-tag-option svg.icon {
font-family: monospace;
white-space: pre;
}
.tag-text::-webkit-scrollbar-thumb:hover {
cursor: pointer; /* Change mouse pointer to a hand */
}

.tag-text,
.tag-list {
Expand Down
21 changes: 20 additions & 1 deletion modules/ui/sections/raw_membership_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { uiSection } from '../section';
import { uiTooltip } from '../tooltip';
import { utilArrayGroupBy, utilArrayIntersection } from '../../util/array';
import { utilDisplayName, utilNoAuto, utilHighlightEntities, utilUniqueDomId } from '../../util';
import * as d3 from 'd3';


export function uiSectionRawMembershipEditor(context) {
Expand Down Expand Up @@ -364,10 +365,28 @@ export function uiSectionRawMembershipEditor(context) {
.attr('for', function(d) {
return d.domId;
});

var tooltip = d3.select('body') // tooltip made for relations
.append('span') // Appending a span as tooltip
.style('position', 'absolute')
.style('visibility', 'hidden')
.style('background-color', 'black')
.style('color', 'white')
.style('padding', '5px')
.style('border-radius', '4px')
.style('pointer-events', 'none') // Prevent interfering with mouse events
.text(''); // Initialize the text of tooltip empty

var labelLink = labelEnter
.append('span')
.attr('class', 'label-text')
.on('mouseover',function(d){
tooltip.text(d.toElement.innerText)
.style('visibility','visible')
.style('top', (d.pageY + 10) + 'px') // Position below the cursor
.style('left', (d.pageX + 10) + 'px'); // Position right of the cursor
}).on('mouseout',function(d){
tooltip.style('visibility','hidden');
})
.append('a')
.attr('href', '#')
.on('click', selectRelation);
Expand Down