Allow identifying the context of the different ULS panels within one app
Add the ulsPurpose option. Empty string by default. This is useful for web application that use ULS in several different context, and need to distinguish what was the purpose of the particular ULS panel. An example of usage can be found at https://phabricator.wikimedia.org/T179402
This commit is contained in:
@@ -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.$element.parents( '.uls-menu' ).data( 'uls-purpose' )
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user