Skip to content

ident filter: fix and improve usability #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@
?>
<li>
<?php echo _("Display with ident:"); ?>
<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
<input type="text" name="identfilter" onchange="fnidentfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
</li>
</ul>
</form>
Expand Down Expand Up @@ -912,7 +912,7 @@
$("#identfilter").on('input', function() {
clearTimeout(typingTimer);
if (this.value) {
typingTimer = setTimeout(identfilter,doneTypingInterval);
typingTimer = setTimeout(fnidentfilter,doneTypingInterval);
}
});
</script>
Expand Down
4 changes: 2 additions & 2 deletions js/map.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ function alliance(selectObj) {
var alliance = selectObj.options[idx].value;
createCookie('filter_alliance',alliance,2);
}
function identfilter() {
var ident = $("#identfilter").value;
function fnidentfilter() {
var ident = $("#identfilter").val();
createCookie('filter_ident',ident,2);
}
function mmsifilter() {
Expand Down
2 changes: 1 addition & 1 deletion require/class.SpotterLive.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function getFilter($filter = array(),$where = false,$and = false) {
}
}
if (isset($filter['ident']) && !empty($filter['ident'])) {
$filter_query_where .= " AND ident = '".$filter['ident']."'";
$filter_query_where .= " AND ident LIKE '".$filter['ident']."%'";
}
if (isset($filter['id']) && !empty($filter['id'])) {
$filter_query_where .= " AND flightaware_id = '".$filter['id']."'";
Expand Down