diff --git a/css/jquery.uls.css b/css/jquery.uls.css index 4e80c6b..7099d96 100644 --- a/css/jquery.uls.css +++ b/css/jquery.uls.css @@ -26,10 +26,12 @@ background-clip: padding-box; } +/* .uls-wide { min-width: 715px; width: 45%; } +*/ .uls-title-region a { padding-left: 15px; diff --git a/src/jquery.uls.core.js b/src/jquery.uls.core.js index 8852d59..7aeee4a 100644 --- a/src/jquery.uls.core.js +++ b/src/jquery.uls.core.js @@ -144,12 +144,20 @@ * @returns {Object} */ position: function () { - var pos = $.extend( {}, this.$element.offset(), { + var width, minWidth, pos; + + width = 11 * this.options.columns; + minWidth = 179 * this.options.columns; + + 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%' + 'width': width + '%', + 'min-width': minWidth, + 'top': this.top !== undefined ? this.top : pos.top + pos.height, + 'left': this.left !== undefined ? this.left : '25%' }; }, @@ -264,6 +272,7 @@ lcd = this.$resultsView.lcd( { languages: this.languages, + columns: this.options.columns, quickList: this.options.quickList, clickhandler: $.proxy( this.select, this ), source: this.$languageFilter, @@ -401,6 +410,7 @@ 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 compact: false, // Show ULS in compact mode + columns: 2, // How many columns of languages to show showRegions: [ 'WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA' ], languageDecorator: null // Callback function to be called when a language link is prepared - for custom decoration. }; diff --git a/src/jquery.uls.lcd.js b/src/jquery.uls.lcd.js index 8ae5638..5884b9a 100644 --- a/src/jquery.uls.lcd.js +++ b/src/jquery.uls.lcd.js @@ -153,8 +153,7 @@ */ renderRegions: function () { var lcd = this, languages, - items = lcd.options.itemsPerColumn, - columns = 4; + items = lcd.options.itemsPerColumn; this.$noResults.addClass( 'hide' ); this.$element.find( '.uls-lcd-region-section' ).each( function () { @@ -173,7 +172,7 @@ return; } - lcd.renderRegion( $region, languages, items, columns ); + lcd.renderRegion( $region, languages, items, lcd.options.columns ); $region.removeClass( 'hide' ); lcd.regionLanguages[regionCode] = []; @@ -386,6 +385,7 @@ }; $.fn.lcd.defaults = { + columns: 4, languages: null, showRegions: ['WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA'], itemsPerColumn: 8,