|
|
|
@ -224,16 +224,15 @@ $(document).ready(function(){ |
|
|
|
$('.off').click(function(){ |
|
|
|
$('.off').click(function(){ |
|
|
|
var url = $(this).attr('href') |
|
|
|
var url = $(this).attr('href') |
|
|
|
var $this = $(this) |
|
|
|
var $this = $(this) |
|
|
|
$.get( |
|
|
|
$.get(url,function(data){ |
|
|
|
url, function(data){ |
|
|
|
|
|
|
|
if (data == 'off'){ |
|
|
|
if (data == 'off'){ |
|
|
|
$this.hide(); |
|
|
|
$this.hide(); |
|
|
|
$this.siblings('.on').show(); |
|
|
|
$this.siblings('.on').show(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
) |
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// end on-of events
|
|
|
|
// end on-of events
|
|
|
|
if( $("#id_city").length ) { |
|
|
|
if( $("#id_city").length ) { |
|
|
|
$('#id_city').select2({ |
|
|
|
$('#id_city').select2({ |
|
|
|
@ -245,7 +244,7 @@ $(document).ready(function(){ |
|
|
|
dataType: "json", |
|
|
|
dataType: "json", |
|
|
|
quietMillis: 200, |
|
|
|
quietMillis: 200, |
|
|
|
|
|
|
|
|
|
|
|
data: function(term, page, country){ |
|
|
|
data: function(term, page){ |
|
|
|
var country = $('#id_country').val(); |
|
|
|
var country = $('#id_country').val(); |
|
|
|
return {term: term, |
|
|
|
return {term: term, |
|
|
|
page: page, |
|
|
|
page: page, |
|
|
|
@ -253,9 +252,11 @@ $(document).ready(function(){ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
results: function (data) { |
|
|
|
results: function (data) { |
|
|
|
|
|
|
|
console.log('results'); |
|
|
|
if (typeof(data) == 'string'){ |
|
|
|
if (typeof(data) == 'string'){ |
|
|
|
data = JSON.parse(data); |
|
|
|
data = JSON.parse(data); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log(data); |
|
|
|
var results = []; |
|
|
|
var results = []; |
|
|
|
$.each(data, function(index, item){ |
|
|
|
$.each(data, function(index, item){ |
|
|
|
results.push({ |
|
|
|
results.push({ |
|
|
|
|