From 23393c0e8a632b0d1c0b24818775cb5706bdef4d Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Wed, 15 Aug 2012 16:16:37 +0530 Subject: [PATCH] Position the language settings * Expose two options: left and top * Make the init script pass that. * Introduce position method in jquery.uls Change-Id: I21f4d956f1ed2c56528731ab09ecc6a89834f796 --- src/jquery.uls.core.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/jquery.uls.core.js b/src/jquery.uls.core.js index c47cae5..eea8a8f 100644 --- a/src/jquery.uls.core.js +++ b/src/jquery.uls.core.js @@ -50,14 +50,23 @@ }, /** - * Show the ULS window + * Calculate the position of ULS + * Returns an object with top and left properties. + * @returns {Object} */ - show: function() { + position: function() { var pos = $.extend( {}, this.$element.offset(), { height: this.$element[0].offsetHeight } ); + return { + top: pos.top + pos.height, + left: '25%' + }; + }, + show: function() { + var pos = this.position(); this.$menu.css( { - top: pos.top + pos.height, + top: pos.top, left: '25%' } );