Skip to content

Commit

Permalink
Modify code for issue #66
Browse files Browse the repository at this point in the history
  • Loading branch information
wez3 committed May 6, 2017
1 parent ad65393 commit a9d5b2e
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,23 @@
});
</script>
<script>
$( document ).on(
"click",
"a",
function( event ){
event.preventDefault();
if (event.target.id != "menu_toggle_button" ) {
location.href = $( event.target ).attr( "href" );
}
}
);
(function(document,navigator,standalone) {
if ((standalone in navigator) && navigator[standalone]) {
var curnode, location=document.location, stop=/^(a|html)$/i;
document.addEventListener('click', function(e) {
if ((e.target.id != "menu_toggle") && (e.target.id != "menu_toggle_button")) {
curnode=e.target;
while (!(stop).test(curnode.nodeName)) {
curnode=curnode.parentNode;
}
if('href' in curnode && ( curnode.href.indexOf('http') || ~curnode.href.indexOf(location.host) ) ) {
e.preventDefault();
location.href = curnode.href;
}
}
},false);
}
})(document,window.navigator,'standalone');
</script>
</body>
</html>

0 comments on commit a9d5b2e

Please sign in to comment.