mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 13:41:15 -07:00
parent
fe034d97b1
commit
eb46ff41fc
3 changed files with 43 additions and 8 deletions
|
@ -86,7 +86,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="collapse navbar-collapse navbar-right" id="navbar-collapse-1">
|
<div class="collapse navbar-collapse navbar-right" id="navbar-collapse-1">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="hidden-sm hidden-xs">
|
<li>
|
||||||
<form action="search" method="post" class="form" id="search_form">
|
<form action="search" method="post" class="form" id="search_form">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-textbox">
|
<span class="input-textbox">
|
||||||
|
@ -395,8 +395,22 @@ ${next.modalIncludes()}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function displaySearch() {
|
||||||
|
if ($(this).width() < 768) {
|
||||||
|
$('#search_button').removeClass('btn-inactive');
|
||||||
|
$('#query').css({ right: 0, width: '100%' })
|
||||||
|
} else if ($('#query').val().trim() == '') {
|
||||||
|
$('#search_button').addClass('btn-inactive');
|
||||||
|
$('#query').css({ right: '-200px', width: '0' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
displaySearch();
|
||||||
|
$(window).resize(function() {
|
||||||
|
displaySearch();
|
||||||
|
});
|
||||||
|
|
||||||
$('#search_form').submit(function (e) {
|
$('#search_form').submit(function (e) {
|
||||||
if ($('#query').hasClass('active') && $('#query').val().trim() != '') {
|
if ($('#query').val().trim() != '') {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'post',
|
type: 'post',
|
||||||
url: 'search',
|
url: 'search',
|
||||||
|
@ -404,14 +418,16 @@ ${next.modalIncludes()}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$('#search_button').removeClass('btn-inactive');
|
if ($(window).width() >= 768) {
|
||||||
$('#query').clearQueue().val('').animate({ right: '0', width: '200px' }).addClass('active').focus();
|
$('#search_button').removeClass('btn-inactive');
|
||||||
|
$('#query').clearQueue().val('').animate({ right: '0', width: '200px' }).addClass('active').focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
$('#query').on('blur', function (e) {
|
$('#query').on('blur', function (e) {
|
||||||
if ($(this).val().trim() == '') {
|
if ($(this).val().trim() == '' && $(window).width() >= 768) {
|
||||||
$(this).delay(200).animate({ right: '-200px', width: '0' }, function () {
|
$(this).delay(200).animate({ right: '-200px', width: '0' }, function () {
|
||||||
$('#search_button').addClass('btn-inactive');
|
displaySearch();
|
||||||
}).removeClass('active');
|
}).removeClass('active');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -3432,6 +3432,22 @@ pre::-webkit-scrollbar-thumb {
|
||||||
-o-transition: background 0.3s;
|
-o-transition: background 0.3s;
|
||||||
transition: background 0.3s;
|
transition: background 0.3s;
|
||||||
}
|
}
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
#search_form {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
#search_form span.input-textbox {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
#search_form #query {
|
||||||
|
width: 100%;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
#search_form #query.active {
|
||||||
|
width: 100%;
|
||||||
|
right: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
#update_search_form div.input-group {
|
#update_search_form div.input-group {
|
||||||
display: inline-table;
|
display: inline-table;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
|
@ -30,8 +30,11 @@
|
||||||
<script>
|
<script>
|
||||||
var query_string = "${query.replace('"','\\"').replace('/','\\/') | n}";
|
var query_string = "${query.replace('"','\\"').replace('/','\\/') | n}";
|
||||||
|
|
||||||
$('#search_button').removeClass('btn-inactive');
|
$('#query').val(query_string);
|
||||||
$('#query').val(query_string).css({ right: '0', width: '250px' }).addClass('active');
|
if ($(window).width() >= 768) {
|
||||||
|
$('#search_button').removeClass('btn-inactive');
|
||||||
|
$('#query').css({ right: '0', width: '250px' }).addClass('active');
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'get_search_results_children',
|
url: 'get_search_results_children',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue