autofocus on user search

sandwich icon fixed
user search starts at the beginning of the string
This commit is contained in:
Ricsi
2017-01-19 23:40:58 +01:00
parent 1b78abb5c7
commit 8dfd618042
4 changed files with 10 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ else $sql = new sql('localhost','tollashodos','uprRscU8bGpJ','tollashodos');
$filter1 = ""; $filter1 = "";
if (!empty($_POST['uk_filter_name'])) { if (!empty($_POST['uk_filter_name'])) {
$filter1 = "AND uk_name LIKE '%".$_POST['uk_filter_name']."%'"; $filter1 = "AND uk_name LIKE '".$_POST['uk_filter_name']."%'";
} }
$filter2 = ""; $filter2 = "";

View File

@@ -73,6 +73,10 @@ setlocale(LC_ALL, 'hu_HU');
onReady(function () { onReady(function () {
show('main_content', true); show('main_content', true);
show('loading', false); show('loading', false);
//user list autofocus Firefox fix
if ($("#uk_filter_name").length) {
$("#uk_filter_name").focus();
}
}); });
</script> </script>

View File

@@ -2,8 +2,7 @@
{if $can_logout} {if $can_logout}
<li class="icon"> <li class="icon">
<a href="javascript:void(0);" onclick="myFunction()"> <a href="javascript:void(0);" onclick="myFunction()">
Menü Menü &#8801;
</a> </a>
<span class="mobile_logout"> <span class="mobile_logout">
{if $page == 'admin'} {if $page == 'admin'}

View File

@@ -10,7 +10,7 @@
<div class="user_filter"> <div class="user_filter">
<input name="uk_filter_name" id="uk_filter_name" placeholder="Keresés..."> <input name="uk_filter_name" id="uk_filter_name" placeholder="Keresés..." autofocus>
<select name="is_active" id="is_active"> <select name="is_active" id="is_active">
<option value="1">Aktív tagok</option> <option value="1">Aktív tagok</option>
<option value="0">Passzív tagok</option> <option value="0">Passzív tagok</option>
@@ -19,6 +19,7 @@
</div> </div>
<div class="list" id="user_list"> <div class="list" id="user_list">
@@ -30,11 +31,12 @@ var Timer;
$( document ).ready(function() { $( document ).ready(function() {
$("#is_active").trigger("change"); $("#is_active").trigger("change");
$("#uk_filter_name").focus();
}); });
$("#is_active").change(search); $("#is_active").change(search);
$("#uk_filter_name").keypress(function() { $("#uk_filter_name").keyup(function() {
document.getElementById('user_list').innerHTML = 'Betöltés...'; document.getElementById('user_list').innerHTML = 'Betöltés...';
clearTimeout(Timer); clearTimeout(Timer);
Timer = window.setTimeout(search, 1000); Timer = window.setTimeout(search, 1000);