Skip to content

Commit 7b7a0bc

Browse files
committed
Set focus for element on examples.htm and api.htm
1 parent 9803078 commit 7b7a0bc

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

docs/api.htm

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -297,21 +297,25 @@ <h1 id="version"><a href=".." style="color:green">JSROOT</a></h1>
297297
SetListener(aaa, shortname, url);
298298

299299
if ('src' in entry) {
300-
aaa = document.createElement( 'a' );
301-
aaa.textContent = " (src)";
302-
aaa.title = "Click to see source of the example";
303-
aaa.href = "https://github.com/linev/jsroot/blob/master/" + ((entry.src===true) ? url : entry.src);
304-
content.appendChild( aaa );
305-
SetSourceListener(aaa, shortname + "_src", ((entry.src===true) ? url : entry.src));
300+
var saaa = document.createElement( 'a' );
301+
saaa.textContent = " (src)";
302+
saaa.title = "Click to see source of the example";
303+
saaa.href = "https://github.com/linev/jsroot/blob/master/" + ((entry.src===true) ? url : entry.src);
304+
content.appendChild( saaa );
305+
SetSourceListener(saaa, shortname + "_src", ((entry.src===true) ? url : entry.src));
306306

307-
if (window.location.hash == "#" + shortname + "_src")
307+
if (window.location.hash == "#" + shortname + "_src") {
308+
saaa.focus();
308309
ProcessSourceClick(((entry.src===true) ? url : entry.src));
310+
}
309311
}
310312

311313
content.appendChild(document.createElement('br'));
312314

313-
if (window.location.hash == "#" + shortname)
314-
ProcessClick(url);
315+
if (window.location.hash == "#" + shortname) {
316+
aaa.focus();
317+
ProcessClick(url);
318+
}
315319
}
316320
}
317321

docs/examples.htm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,7 @@ <h1 id="version"><a href=".." style="color:green">JSROOT</a></h1>
711711
}
712712

713713
if (window.location.hash == "#" + shortname) {
714+
aaa.focus();
714715
ProcessClick(url, filename, itemname, opt, jsonname);
715716
}
716717
}

0 commit comments

Comments
 (0)