Skip to content

Commit 2974c57

Browse files
committed
Made search scroll to matches, particularly on navigation
1 parent 4c2258f commit 2974c57

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client/src/visualizer_ui.js

+3
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,9 @@ var VisualizerUI = (function($, window, undefined) {
18021802
if (args && !args.edited) {
18031803
var svgtop = $('svg').offset().top;
18041804
var $inFocus = $('#svg animate[data-type="focus"]:first').parent();
1805+
if (!$inFocus.length && args.matchfocus) {
1806+
$inFocus = $('[data-span-id=' + args.matchfocus + ']');
1807+
}
18051808
if ($inFocus.length) {
18061809
$('html,body').
18071810
animate({ scrollTop: $inFocus.offset().top - svgtop - window.innerHeight / 2 }, { duration: 'slow', easing: 'swing'});

0 commit comments

Comments
 (0)