Skip to content

Commit 5fe90a2

Browse files
committed
Fixed top menu if js error
1 parent 6b661ea commit 5fe90a2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

javascripts/theme.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ window.classie = {
5151

5252
})( window );
5353

54-
$(document).ready(function(){
54+
function addElements (){
5555
$( '<div id="menu"><div class="burger"><div class="one"></div><div class="two"></div><div class="three"></div></div><div class="circle"></div></div>' ).insertBefore( $( "#top-menu" ) );
5656

5757
var menuLeft = document.getElementById( 'top-menu' ),
@@ -68,5 +68,12 @@ $(document).ready(function(){
6868
classie.toggle( menuLeft, 'open' );
6969
};
7070
$( 'input[name$="q"]' ).attr( 'placeholder','Enter Search Text' );
71-
})
71+
}
72+
73+
$(document).ready(addElements)
7274

75+
window.onerror = function myErrorFunction(message, url, linenumber) {
76+
if (location.href.indexOf("/dmsf") != -1){
77+
$(document).ready(addElements)
78+
}
79+
}

0 commit comments

Comments
 (0)