Implemented feedback and moved JS to a file.
See https://fc.oscp.info/display/beanow/245480
This commit is contained in:
parent
a54e512669
commit
6becf45e73
5 changed files with 19 additions and 9 deletions
15
assets/js/main.js
Normal file
15
assets/js/main.js
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
jQuery(function($){
|
||||||
|
|
||||||
|
//Mobile menu, hamburger button.
|
||||||
|
$('body').on('click', '.hamburger', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
$('nav#links').toggleClass('open');
|
||||||
|
});
|
||||||
|
|
||||||
|
//Forces the reset to empty the search field, not reset it to the PHP given value.
|
||||||
|
$('.search-wrapper').on('click', '.reset', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
$(e.target).closest('.search-wrapper').find('.search-field').val('');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
|
@ -133,6 +133,7 @@ nav#links a{
|
||||||
}
|
}
|
||||||
|
|
||||||
nav#links a,
|
nav#links a,
|
||||||
|
.sub-menu-outer a,
|
||||||
.profiles a{
|
.profiles a{
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,4 @@
|
||||||
<a href="/stats">Stats</a>
|
<a href="/stats">Stats</a>
|
||||||
<a href="/help">Help</a>
|
<a href="/help">Help</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery('.hamburger').on('click', function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
jQuery('nav#links').toggleClass('open');
|
|
||||||
})
|
|
||||||
</script>
|
|
|
@ -1,6 +1,6 @@
|
||||||
<form action="/search" method="get" class="search-form">
|
<form action="/search" method="get" class="search-form">
|
||||||
<div class="search-wrapper">
|
<div class="search-wrapper">
|
||||||
<input class="search-field" type="text" name="query" placeholder="<?php echo $query ? $query : 'Search your friends'; ?>" tabindex="1" autofocus />
|
<input class="search-field" type="text" name="query" placeholder="Search your friends" tabindex="1" value="<?php echo $query; ?>" />
|
||||||
<input class="reset" type="reset" value="" tabindex="3" />
|
<input class="reset" type="reset" value="" tabindex="3" />
|
||||||
<input class="search" type="submit" value="Search" tabindex="2" />
|
<input class="search" type="submit" value="Search" tabindex="2" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
<link href="/assets/style.css" rel="stylesheet" type="text/css" />
|
<link href="/assets/style.css" rel="stylesheet" type="text/css" />
|
||||||
|
|
||||||
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.2.min.js"></script>
|
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.2.min.js"></script>
|
||||||
|
<script type="text/javascript" src="/assets/js/main.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<?php if(isset($topBar)) echo $topBar; ?>
|
<?php if(isset($topBar)) echo $topBar; ?>
|
||||||
|
|
Loading…
Reference in a new issue