Merge pull request #299 from amire80/ulsPurpose

Allow identifying the context of the different ULS panels within one app
This commit is contained in:
Niklas Laxström
2018-03-05 15:24:47 +02:00
committed by GitHub
2 changed files with 14 additions and 1 deletions

View File

@@ -230,6 +230,7 @@
this.$languageFilter.languagefilter( {
lcd: lcd,
languages: this.languages,
ulsPurpose: this.options.ulsPurpose,
searchAPI: this.options.searchAPI,
onSelect: $.proxy( this.select, this )
} );
@@ -393,6 +394,10 @@
// The options are wide (4 columns), medium (2 columns), and narrow (1 column).
// If not specified, it will be set automatically.
menuWidth: undefined,
// What is this ULS used for.
// Should be set for distinguishing between different instances of ULS
// in the same application.
ulsPurpose: '',
// Used by LCD
quickList: [],
// Used by LCD

View File

@@ -233,7 +233,11 @@
resultHandler: function ( query, results, autofillLabel ) {
if ( results.length === 0 ) {
this.$suggestion.val( '' );
this.$element.trigger( 'noresults.uls', query );
this.$element.trigger(
'noresults.uls',
query,
this.options.ulsPurpose
);
return;
}
@@ -338,6 +342,10 @@
lcd: undefined,
// URL to which we append query parameter with the query value
searchAPI: undefined,
// What is this ULS used for.
// Should be set for distinguishing between different instances of ULS
// in the same application.
ulsPurpose: '',
// Object of language tags to language names
languages: [],
// Callback function when language is selected