Update jquery.uls from upstream

Like Iecec180ca01a40f0333e5b75914dcdb0c390f6b8
but includes also the unbreak fix by Hoo man
( https://github.com/wikimedia/jquery.uls/pull/238 ).

Updating to
d77da03dbf

Bug: T144871
Bug: T138235
Bug: T137870
Change-Id: I0bafd39385148fd09e7793805f698a43a237e204
This commit is contained in:
Amire80
2016-09-07 13:09:26 +03:00
parent 1400354f43
commit f03f973093
15 changed files with 132 additions and 132 deletions

View File

@@ -91,7 +91,7 @@
this.initialized = false;
this.$languageFilter = this.$menu.find( '#uls-languagefilter' );
this.$resultsView = this.$menu.find( 'div.uls-language-list' );
this.$resultsView = this.$menu.find( '.uls-language-list' );
this.render();
this.listen();
@@ -134,15 +134,25 @@
* @returns {Object}
*/
position: function () {
var pos;
var pos,
top = this.top,
left = this.left;
if ( top === undefined ) {
pos = $.extend( {}, this.$element.offset(), {
height: this.$element[ 0 ].offsetHeight
} );
top = pos.top + pos.height;
}
if ( left === undefined ) {
left = $( window ).width() / 2 - this.$menu.outerWidth() / 2;
}
pos = $.extend( {}, this.$element.offset(), {
height: this.$element[ 0 ].offsetHeight
} );
return {
top: this.top !== undefined ? this.top : pos.top + pos.height,
left: this.left !== undefined ? this.left : '25%'
top: top,
left: left
};
},
@@ -157,7 +167,6 @@
};
this.$menu.addClass( widthClasses[this.getMenuWidth()] );
this.$menu.css( this.position() );
if ( !this.initialized ) {
$( 'body' ).prepend( this.$menu );
@@ -165,6 +174,7 @@
this.initialized = true;
}
this.$menu.css( this.position() );
this.$menu.show();
this.$menu.scrollIntoView();
this.shown = true;
@@ -250,7 +260,7 @@
languages: this.languages,
columns: columnsOptions[ this.getMenuWidth() ],
quickList: languagesCount > 12 ? this.options.quickList : false,
quickList: languagesCount > 12 ? this.options.quickList : [],
clickhandler: $.proxy( this.select, this ),
source: this.$languageFilter,
showRegions: this.options.showRegions,
@@ -348,7 +358,7 @@
languagesCount = objectLength( this.options.languages );
if ( languagesCount < 12 ) {
if ( languagesCount < 25 ) {
return 'narrow';
}
@@ -387,7 +397,7 @@
onSelect: null, // Callback function to be called when a language is selected
searchAPI: null, // Language search API
languages: $.uls.data.getAutonyms(), // Languages to be used for ULS, default is all languages
quickList: null, // Array of language codes or function that returns such
quickList: [], // Array of language codes or function that returns such
// The options are wide (4 columns), medium (2 columns), and narrow (1 column).
// If not specified, it will be set automatically.
menuWidth: null,