Only add search parameter to getcontents request when search field is not empty
This commit is contained in:
parent
eb04386d68
commit
6b58de0033
|
@ -49,9 +49,11 @@ function redirectToLogin() {
|
||||||
|
|
||||||
function getContents() {
|
function getContents() {
|
||||||
if ( searchTimeout ) clearTimeout(searchTimeout);
|
if ( searchTimeout ) clearTimeout(searchTimeout);
|
||||||
|
var data = {};
|
||||||
|
if ( $("#search").val() != "" ) data.search = $("#search").val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : 'ajax/getcontents.php',
|
url : 'ajax/getcontents.php',
|
||||||
data : {search: $("#search").val()},
|
data : data,
|
||||||
dataType : 'json',
|
dataType : 'json',
|
||||||
success : function(data, stat, jqo) {
|
success : function(data, stat, jqo) {
|
||||||
if ( data.validated == false ) redirectToLogin();
|
if ( data.validated == false ) redirectToLogin();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user