Skip to content

Commit 6426bb3

Browse files
authored
Merge pull request #6235 from mamhoff/quietmillis-select2
Add 500ms delay before AJAX in Select2
2 parents f0a7456 + 4eec479 commit 6426bb3

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

backend/app/assets/javascripts/spree/backend/option_value_picker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ $.fn.optionValueAutocomplete = function (options) {
2323
},
2424
ajax: {
2525
url: Spree.pathFor('api/option_values'),
26+
quietMillis: 500,
2627
datatype: 'json',
2728
data: function (term, page) {
2829
var productId = typeof(productSelect) !== 'undefined' ? $(productSelect).select2('val') : null;

backend/app/assets/javascripts/spree/backend/product_picker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ $.fn.productAutocomplete = function (options) {
3535
this.select2({
3636
minimumInputLength: 3,
3737
multiple: multiple,
38+
quietMillis: 500,
3839
initSelection: function (element, callback) {
3940
$.get(Spree.pathFor('admin/search/products'), {
4041
ids: element.val().split(','),

backend/app/assets/javascripts/spree/backend/taxon_autocomplete.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ $.fn.taxonAutocomplete = function (options) {
4747
},
4848
ajax: {
4949
url: Spree.pathFor('api/taxons'),
50+
quietMillis: 500,
5051
datatype: 'json',
5152
data: function (term, page) {
5253
return {

0 commit comments

Comments
 (0)