Skip to content

Commit a9de713

Browse files
committed
fix embedded links
1 parent 8c54c09 commit a9de713

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

theme/theme.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ function open_topmenu(){
297297

298298
var q = "<?php echo $q; ?>";
299299
q = q.split("/");
300+
300301
if (q[0] && q[1] != ("")) {
301302
sl = $(".sublevel[name="+q[1]+"]");
302303
tl = $(".toplevel[name="+q[0]+"]");
@@ -601,8 +602,8 @@ function anchorAttach() {
601602
var holdLink_inp = "";
602603
if ($(this).hasClass("chapterCopy")) {
603604
var chapter_embedlink = $(this).attr('name');
604-
var top_menu_link = $(".toplevelhead.activeLink_clickedOnce").text().trim();
605-
var mid_menu_link = $(".sublevelhead.activeLink_clickedOnce").text().trim();
605+
var top_menu_link = $(".toplevelhead.clickedOnce").text().trim();
606+
var mid_menu_link = $(".sublevelhead.clickedOnce").text().trim();
606607
holdLink_inp = "<a href=" + "'" + chapter_embedlink + "'" + ">" +
607608
"Learn&rarr;" +
608609
top_menu_link + "&rarr;" +
@@ -663,8 +664,10 @@ function anchorAttach() {
663664
// Scroll Down to Active Link in the Menu...
664665
// ----------------------------------------------------------------------------------------
665666

666-
var notify = $(".sublevelhead.activeLink_clickedOnce").offset();
667-
var notify = notify.top - 42;
667+
if ($(".sublevelhead.activeLink_clickedOnce")) {
668+
var notify = $(".sublevelhead.activeLink_clickedOnce").offset();
669+
var notify = notify.top - 42;
670+
}
668671

669672
$(".sidenav").animate({scrollTop:notify},600);
670673

0 commit comments

Comments
 (0)