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:
Amire80
2018-03-04 23:01:35 +02:00
parent 2d98203aab
commit ddb691a918
2 changed files with 10 additions and 1 deletions

View File

@@ -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