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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user