MCPcopy Create free account
hub / github.com/KDAB/codebrowser / onMouseEnterRef

Function onMouseEnterRef

data/codebrowser.js:487–863  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

485
486 // Mouse interaction (tooltip, ...)
487 var onMouseEnterRef = function(e) {
488 if (skipHighlightTimerId) return false;
489 var elem = $(this);
490 var isMacro = elem.hasClass("macro");
491 var ref = elem.attr("data-ref");
492 var proj = elem.attr("data-proj");
493
494 var proj_root_path = root_path;
495 if (proj) { proj_root_path = projects[proj]; }
496
497 var url = proj_root_path + "/refs/" + ref;
498
499 if (!$(this).hasClass("highlight")) {
500 highlight_items(ref);
501 }
502
503 var computeTooltipContent = function(data, title, id) {
504 var type ="", content ="";
505 var tt = tooltip.tooltip;
506 var showUseFunc = function(e) {
507 e.stopPropagation();
508 tt.find(".uses").toggle();
509 return false;
510 };
511
512 var symbolUrl;
513 if (data) { // this mean the ref symbol exists
514 var absoluteRoot = absoluteUrl(proj_root_path);
515 var absoluteDataPath = absoluteUrl(data_path);
516 symbolUrl = data_path + "/symbol.html?root=" + computeRelativeUrlTo(absoluteDataPath, absoluteRoot) + "&ref=" + ref;
517 }
518
519 if (elem.hasClass("local") || elem.hasClass("tu") || elem.hasClass("lbl")
520 || (isMacro && !data && ref)) {
521 type = $("#" + escape_selector(ref)).attr("data-type");
522
523 var docs = $("i[data-doc='"+escape_selector(ref)+"']");
524 docs.each(function() {
525 var comment = $(this).html();
526 content += "<br/><i>" + comment + "</i>";
527 var l = $(this).parent().prev("th").text();
528 if (l) {
529 var url = "#" + l;
530 content += " <a href='" + url +"'>&#8618;</a>";
531 }
532
533 });
534
535 //var uses = highlighted_items;
536 var uses = $(".code [data-ref='"+escape_selector(ref)+"']");
537 var usesLis ="";
538 var usesCount = 0;
539 uses.each(function() {
540 var t = $(this);
541 var l = t.parents("td").prev("th").text();
542
543 if (t.hasClass("def")) {
544 content += "<br/><a href='#"+ l +"'>Definition</a>";

Callers

nothing calls this directly

Calls 4

highlight_itemsFunction · 0.85
identAndHighlightMacroFunction · 0.85
computeTooltipContentFunction · 0.85
prefixLenFunction · 0.70

Tested by

no test coverage detected