Skip to content

Commit

Permalink
Merge pull request ExactTarget#346 from vernak2539/select_auto_resize…
Browse files Browse the repository at this point in the history
…_without_fuelux_html_class

Modifying where select control dynamically places sizing element
  • Loading branch information
vernak2539 committed Dec 4, 2013
2 parents e65e1f2 + 034985f commit a8dbcdb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ define(function(require) {
var sizer = $('<div/>').addClass('select-sizer');
var width = 0;

$('body').append(sizer);
if( Boolean( $(document).find( 'html' ).hasClass( 'fuelux' ) ) ) {
// default behavior for fuel ux setup. means fuelux was a class on the html tag
$( document.body ).append( sizer );
} else {
// fuelux is not a class on the html tag. So we'll look for the first one we find so the correct styles get applied to the sizer
$( '.fuelux:first' ).append( sizer );
}

// iterate through each item to find longest string
this.$element.find('a').each(function () {
Expand Down

0 comments on commit a8dbcdb

Please sign in to comment.