Merge pull request #307 from amire80/noResults-param

Update the argument for noResults in lcd
This commit is contained in:
Niklas Laxström
2018-03-15 17:39:52 +02:00
committed by GitHub

View File

@@ -382,9 +382,9 @@
/** /**
* No-results event handler * No-results event handler
* @param {Event} event * @param {Event} event
* @param {string} [currentSearchQuery] Current search query that gave mp results * @param {Object} data Information about the failed search query
*/ */
noResults: function ( event, currentSearchQuery ) { noResults: function ( event, data ) {
var $noResults; var $noResults;
this.$element.addClass( 'uls-no-results' ); this.$element.addClass( 'uls-no-results' );
@@ -393,7 +393,7 @@
if ( typeof this.options.noResultsTemplate === 'function' ) { if ( typeof this.options.noResultsTemplate === 'function' ) {
$noResults = $noResults =
this.options.noResultsTemplate.call( this, currentSearchQuery ); this.options.noResultsTemplate.call( this, data.query );
} else if ( this.options.noResultsTemplate instanceof jQuery ) { } else if ( this.options.noResultsTemplate instanceof jQuery ) {
$noResults = this.options.noResultsTemplate; $noResults = this.options.noResultsTemplate;
} else { } else {
@@ -448,7 +448,8 @@
quickList: [], quickList: [],
// Callback function for language selection // Callback function for language selection
clickhandler: undefined, clickhandler: undefined,
// Callback function when no search results // Callback function when no search results.
// If overloaded, it can accept the search string as an argument.
noResultsTemplate: function () { noResultsTemplate: function () {
var $suggestionsContainer, $suggestions, var $suggestionsContainer, $suggestions,
$noResultsTemplate = $( noResultsTemplate ); $noResultsTemplate = $( noResultsTemplate );