diff --git a/lib/jquery.uls/src/jquery.uls.core.js b/lib/jquery.uls/src/jquery.uls.core.js index 86615788..fcf489d6 100644 --- a/lib/jquery.uls/src/jquery.uls.core.js +++ b/lib/jquery.uls/src/jquery.uls.core.js @@ -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). diff --git a/lib/jquery.uls/src/jquery.uls.data.js b/lib/jquery.uls/src/jquery.uls.data.js index 9d137ae2..de38e95c 100644 --- a/lib/jquery.uls/src/jquery.uls.data.js +++ b/lib/jquery.uls/src/jquery.uls.data.js @@ -1,7 +1,9 @@ -(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i