move toggleMenu call from html onclick to DOM addEventListener

This commit is contained in:
mappu 2017-12-10 12:19:07 +13:00
parent 3c3028b8d1
commit 149e226729
3 changed files with 8 additions and 2 deletions

View File

@ -191,9 +191,9 @@ func (this *ArchiveState) renderTemplateHead(w http.ResponseWriter) {
<a href="/download" onclick="return confirm('Are you sure you want to download a backup?');">Download backup</a>
</div>
<a onclick="toggleMenu();"><div id="logo" class="layout-pushdown"><svg viewBox="0 0 24 24">
<div id="logo" class="layout-pushdown"><svg viewBox="0 0 24 24">
<path fill="#000000" d="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z" />
</svg></div></a>
</svg></div>
<span class="area-nav">

View File

@ -93,6 +93,10 @@ function onLoad() {
//
document.getElementById("logo").addEventListener("click", toggleMenu);
//
if (
! /\/search\//.test(window.location.pathname) &&
document.location.hash.substr(0, 6) === '#line-'

View File

@ -122,6 +122,8 @@ select {
}
#logo {
cursor:pointer;
display:inline-block;
width:16px;
height:16px;