Defect #11909 » application.js-emptyquery.patch
| public/javascripts/application.js | ||
|---|---|---|
|
var val = $this.val();
|
||
|
if ($this.attr('data-value-was') != val){
|
||
|
$this.attr('data-value-was', val);
|
||
|
if (val != '') {
|
||
|
$.ajax({
|
||
|
url: url,
|
||
|
type: 'get',
|
||
|
data: {q: $this.val()},
|
||
|
success: function(data){ $('#'+targetId).html(data); },
|
||
|
beforeSend: function(){ $this.addClass('ajax-loading'); },
|
||
|
complete: function(){ $this.removeClass('ajax-loading'); }
|
||
|
});
|
||
|
}
|
||
|
$.ajax({
|
||
|
url: url,
|
||
|
type: 'get',
|
||
|
data: {q: $this.val()},
|
||
|
success: function(data){ $('#'+targetId).html(data); },
|
||
|
beforeSend: function(){ $this.addClass('ajax-loading'); },
|
||
|
complete: function(){ $this.removeClass('ajax-loading'); }
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
var reset = function() {
|
||