Update jquery.uls to 5c7ff63

* Support for onPosition callback

Change-Id: Ia877ce3dfcd1aa382b12470c378a65b36cc9abd5
This commit is contained in:
Niklas Laxström
2021-03-22 13:10:51 +01:00
parent e5a2c48058
commit ffc9c20fdb
2 changed files with 18 additions and 8 deletions

View File

@@ -119,6 +119,11 @@
top = this.top,
left = this.left;
if ( this.options.onPosition ) {
return this.options.onPosition.call( this );
}
// Default implementation (middle of the screen under the trigger)
if ( top === undefined ) {
pos = $.extend( {}, this.$element.offset(), {
height: this.$element[ 0 ].offsetHeight
@@ -380,9 +385,9 @@
};
$.fn.uls.defaults = {
// CSS top position for the dialog
// DEPRECATED: CSS top position for the dialog
top: undefined,
// CSS left position for the dialog
// DEPRECATED: CSS left position for the dialog
left: undefined,
// Callback function when user selects a language
onSelect: undefined,
@@ -392,6 +397,8 @@
onReady: undefined,
// Callback function when ULS dialog is shown
onVisible: undefined,
// Callback function when ULS dialog is ready to be shown
onPosition: undefined,
// Languages to be used for ULS, default is all languages
languages: $.uls.data.getAutonyms(),
// The options are wide (4 columns), medium (2 columns), and narrow (1 column).