js cleanups
This commit is contained in:
parent
42cb8a0b25
commit
c2a34f5732
@ -5,10 +5,10 @@ $('#<%= field_id %>').select2({
|
||||
url: '<%= ajax_url %>',
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
data: function (params) {
|
||||
data: function(params) {
|
||||
return { q: params.term };
|
||||
},
|
||||
processResults: function (data, params) {
|
||||
processResults: function(data, params) {
|
||||
return { results: data };
|
||||
},
|
||||
cache: true
|
||||
|
@ -10,9 +10,10 @@ function filterAdditionalsFormatState (opt) {
|
||||
return $opt;
|
||||
}
|
||||
|
||||
/* global availableFilters additionals_field_formats additionals_filter_urls:true* */
|
||||
function additionals_transform_to_select2(field){
|
||||
field_format = availableFilters[field]['field_format'];
|
||||
initialized_select2 = $('#tr_' + field + ' .values .select2');
|
||||
var field_format = availableFilters[field]['field_format'];
|
||||
var initialized_select2 = $('#tr_' + field + ' .values .select2');
|
||||
if (initialized_select2.size() == 0 && $.inArray(field_format, additionals_field_formats) >= 0) {
|
||||
$('#tr_' + field + ' .toggle-multiselect').hide();
|
||||
$('#tr_' + field + ' .values .value').attr('multiple', 'multiple');
|
||||
@ -21,10 +22,10 @@ function additionals_transform_to_select2(field){
|
||||
url: additionals_filter_urls[field_format],
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
data: function (params) {
|
||||
data: function(params) {
|
||||
return { q: params.term };
|
||||
},
|
||||
processResults: function (data, params) {
|
||||
processResults: function(data, params) {
|
||||
return { results: data };
|
||||
},
|
||||
cache: true
|
||||
|
Loading…
x
Reference in New Issue
Block a user