From: Timo Tijhof Date: Thu, 2 Apr 2015 12:08:07 +0000 (+0100) Subject: jquery.suggestions: Document the callback context and parameters X-Git-Tag: 1.31.0-rc.0~11850^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=28f2cb045e84dd3c97bf0a9cbefaf4764a157db6;p=lhc%2Fweb%2Fwiklou.git jquery.suggestions: Document the callback context and parameters Change-Id: Ida73a836952b66476bfff4925ea6c1eee3e58b52 --- diff --git a/resources/src/jquery/jquery.suggestions.js b/resources/src/jquery/jquery.suggestions.js index f1b214e4dc..59f09a8f4b 100644 --- a/resources/src/jquery/jquery.suggestions.js +++ b/resources/src/jquery/jquery.suggestions.js @@ -13,16 +13,38 @@ * * Options: * - * fetch(query): Callback that should fetch suggestions and set the suggestions property. - * Executed in the context of the textbox + * fetch: Callback that should fetch suggestions and set the suggestions property. * Type: Function + * Context: The textbox + * Param: String query + * Param: Function response(suggestions) Callback to receive the suggestions + * Param: Number maxRows * cancel: Callback function to call when any pending asynchronous suggestions fetches - * should be canceled. Executed in the context of the textbox + * should be canceled. + * Context: The textbox * Type: Function * special: Set of callbacks for rendering and selecting * Type: Object of Functions 'render' and 'select' + * special.render + * Type: Function + * Context: The suggestions-special element + * Param: String query + * Param: Object context + * special.select + * Type: Function + * Context: The suggestions-result-current element + * Param: jQuery The textbox * result: Set of callbacks for rendering and selecting * Type: Object of Functions 'render' and 'select' + * result.render + * Type: Function + * Context: The suggestions-result element + * Param: String suggestion + * Param: Object context + * result.select + * Context: The suggestions-result-current element + * Param: String query + * Param: Object context * $region: jQuery selection of element to place the suggestions below and match width of * Type: jQuery Object, Default: $( this ) * suggestions: Suggestions to display