1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-27 20:10:18 +02:00

[ticket/10737] Using JQuery events and JSON response.

PHPBB3-10737
This commit is contained in:
Suhaib Khan
2014-02-21 13:01:22 +05:30
committed by Cesar G
parent b5ee81dae6
commit dd07efcac7
4 changed files with 33 additions and 50 deletions

View File

@@ -512,6 +512,32 @@ phpbb.timezonePreselectSelect = function(forceSelector) {
}
};
// Listen live search box events
$('.liveinput').keyup(function() {
var str = this.value;
var j = 0;
if (str.length < 3) {
$("#livesearch").innerHTML="";
return;
}
$.ajax({
url:'memberlist.php?mode=livesearch&'+"&q="+str,
success:function(result) {
$.each(result, function(idx, elem) {
j = (idx%2)+1;
$("#livesearch").append("<tr class='bg" + j + " row" + j + "'><td><a href='memberlist.php?mode=viewprofile&u=" + elem.id + "' target='_blank'>" + elem.name + "</a></td></tr>");
})
}
});
});
$('.liveinput').blur(function() {
setTimeout(function () {
document.getElementById("livesearch").innerHTML="";
}, 500);
});
// Toggle notification list
$('#notification_list_button').click(function(e) {
$('#notification_list').toggle();