diff --git a/src/jquery.uls.core.js b/src/jquery.uls.core.js index 36f30a5..98e1c76 100644 --- a/src/jquery.uls.core.js +++ b/src/jquery.uls.core.js @@ -54,6 +54,7 @@ this.$element = $( element ); this.options = $.extend( {}, $.fn.uls.defaults, options ); this.$menu = $( template ); + this.$menu.data( 'uls-purpose', this.options.ulsPurpose ); this.languages = this.options.languages; for ( code in this.languages ) { @@ -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 diff --git a/src/jquery.uls.languagefilter.js b/src/jquery.uls.languagefilter.js index edaa0e7..3a5e0af 100644 --- a/src/jquery.uls.languagefilter.js +++ b/src/jquery.uls.languagefilter.js @@ -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; }