mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/10737] Adding delayed keyup and removing target_blank.
PHPBB3-10737
This commit is contained in:
parent
6ef4e4e790
commit
a60d9a7f86
3 changed files with 39 additions and 28 deletions
|
@ -513,8 +513,17 @@ phpbb.timezonePreselectSelect = function(forceSelector) {
|
|||
};
|
||||
|
||||
// Listen live search box events
|
||||
var delay = (function(){
|
||||
var timer = 0;
|
||||
return function(callback, ms){
|
||||
clearTimeout (timer);
|
||||
timer = setTimeout(callback, ms);
|
||||
};
|
||||
})();
|
||||
|
||||
$('.live-search-input').keyup(function() {
|
||||
var str = this.value;
|
||||
delay(function(){
|
||||
if (str.length < 3) {
|
||||
return;
|
||||
}
|
||||
|
@ -536,14 +545,16 @@ $('.live-search-input').keyup(function() {
|
|||
});
|
||||
}
|
||||
});
|
||||
}, 2000 );
|
||||
});
|
||||
|
||||
$('.live-search-input').blur(function() {
|
||||
setTimeout(function () {
|
||||
$(document).click(function(event) {
|
||||
var target = $( event.target );
|
||||
if(!target.is("#livesearch, #livesearch *, .live-search-input")) {
|
||||
var clone = $("#user-search-row-tpl").clone();
|
||||
$("#livesearch").html("");
|
||||
clone.appendTo("#livesearch");
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
|
||||
// Toggle notification list
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<dd><input type="text" name="username" id="username" value="{USERNAME}" class="inputbox live-search-input" autocomplete="off" />
|
||||
<table class="table1 zebra-list" id="livesearch">
|
||||
<tr id="user-search-row-tpl" style="display: none;">
|
||||
<td><a class="user-search-link user-search-name" target="_blank"></a></td>
|
||||
<td><a class="user-search-link user-search-name" ></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</dd>
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
<input class="post live-search-input" type="text" name="username" value="{USERNAME}" autocomplete="off" />
|
||||
<table class="tablebg" id="livesearch">
|
||||
<tr id="user-search-row-tpl" style="display: none;">
|
||||
<td><a class="user-search-link user-search-name" target="_blank"></a></td>
|
||||
<td><a class="user-search-link user-search-name" ></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
|
Loading…
Add table
Reference in a new issue