IW4M-Admin/WebfrontCore/wwwroot/js/search.js
RaidMax 5042ea6c91 [issue 135] enhanced search
implement enhanced search for chat messages
2020-05-22 20:29:41 -05:00

26 lines
930 B
JavaScript

$(document).ready(function() {
$('.form-inline').submit(function(e) {
if ($('#client_search').val().length < 3) {
e.preventDefault();
$('#client_search')
.addClass('input-text-danger')
.delay(25)
.queue(function () {
$(this).addClass('input-border-transition').dequeue();
})
.delay(1000)
.queue(function () {
$(this).removeClass('input-text-danger').dequeue();
})
.delay(500)
.queue(function () {
$(this).removeClass('input-border-transition').dequeue();
});
}
else if ($('#client_search').val().startsWith("chat|")) {
e.preventDefault();
window.location = "/Message/Find?query=" + $('#client_search').val();
}
});
});