diff --git a/bower.json b/bower.json index 1a1fa99e..834e4957 100644 --- a/bower.json +++ b/bower.json @@ -3,7 +3,7 @@ "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.", "main": [ "dist/js/select2.js", - "dist/css/select2.css" + "src/scss/core.scss" ], "repository": { "type": "git", diff --git a/docs/_includes/examples/data.html b/docs/_includes/examples/data.html index 1065226e..42e3acbd 100644 --- a/docs/_includes/examples/data.html +++ b/docs/_includes/examples/data.html @@ -96,12 +96,18 @@ $(".js-data-example-ajax").select2({ page: params.page }; }, - processResults: function (data, page) { - // parse the results into the format expected by Select2. + processResults: function (data, params) { + // parse the results into the format expected by Select2 // since we are using custom formatting functions we do not need to - // alter the remote JSON data + // alter the remote JSON data, except to indicate that infinite + // scrolling can be used + params.page = params.page || 1; + return { - results: data.items + results: data.items, + pagination: { + more: (params.page * 30) < data.total_count + } }; }, cache: true diff --git a/src/js/select2/data/ajax.js b/src/js/select2/data/ajax.js index d54b5a58..0b6a6d5e 100644 --- a/src/js/select2/data/ajax.js +++ b/src/js/select2/data/ajax.js @@ -10,7 +10,7 @@ define([ this.processResults = this.ajaxOptions.processResults; } - ArrayAdapter.__super__.constructor.call(this, $element, options); + AjaxAdapter.__super__.constructor.call(this, $element, options); } Utils.Extend(AjaxAdapter, ArrayAdapter);