From 437e6b1267a0c9121bf9488b98ba9df5b11063c5 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 3 Nov 2021 14:46:53 -0300 Subject: [PATCH] Bug 29397: Add function documentation Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/js/select2.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/select2.js b/koha-tmpl/intranet-tmpl/prog/js/select2.js index 3ac63d0043..df8b108d84 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/select2.js +++ b/koha-tmpl/intranet-tmpl/prog/js/select2.js @@ -58,8 +58,15 @@ function kohaSelect2Transport(params, success, failure) { $request.fail(failure); } -/* wrapper that nests paging information into the results object for use with koha REST apis */ (function($) { + + /** + * Create a new Select2 instance that uses the Koha RESTful API response headers to + * read pagination information + * @param {Object} config Please see the Select2 documentation for further details + * @return {Object} The Select2 instance + */ + $.fn.kohaSelect = function(config) { if (config.hasOwnProperty('ajax')) { config.ajax.transport = function(params, success, failure) { -- 2.39.5