diff --git a/dev/dev.html b/dev/dev.html index 3513a6597..7fba40f44 100644 --- a/dev/dev.html +++ b/dev/dev.html @@ -331,7 +331,7 @@ }); })(); require(['jquery', '../data','underscore', 'fuelux/all'], function($, data,_) { - $('#triggerModal').modal('show'); +// $('#triggerModal').modal('show'); $('.card').on('click', function () { $('.card').removeClass('active'); @@ -346,6 +346,54 @@ +
+
+
+
+ + + +
+ + + +
+ + +
+
+ + +
@@ -1384,7 +1432,9 @@
Loyal Customer
- + + + diff --git a/js/selectlist.js b/js/selectlist.js index b4e67f0f3..5ab50c487 100644 --- a/js/selectlist.js +++ b/js/selectlist.js @@ -105,6 +105,8 @@ }, resize: function() { + var width = 0; + var newWidth = 0; var sizer = $('
').addClass('selectlist-sizer selectlist'); var btnSizer = $('
').addClass('button-sizer selectlist'); @@ -117,22 +119,20 @@ $( '.fuelux:first' ).append( sizer ).append(btnSizer); } - btnSizer.append(this.$button.clone()); - sizer.append(this.$dropdownMenu.clone()); + sizer.append(this.$element.clone()); + this.$element.find('a').each(function () { + sizer.find('.selected-label').text($(this).text()); + newWidth = sizer.outerWidth(); + if(newWidth > width) { + width = newWidth; + } + }); - var btnWidth = btnSizer.outerWidth(); - var width = sizer.find('.dropdown-menu').outerWidth(); + this.$button.css('width', width); + this.$dropdownMenu.css('width', width); - if (btnWidth > width){ - this.$dropdownMenu.css('width', btnWidth); - } - else { - this.$button.css('width', width); - this.$dropdownMenu.css('width', width); - } sizer.remove(); - btnSizer.remove(); }, diff --git a/less/misc.less b/less/misc.less index cfc903dee..d8561a1b6 100644 --- a/less/misc.less +++ b/less/misc.less @@ -46,15 +46,3 @@ input, textarea { position:absolute; left:-9999px; } - -.button-sizer, .selectlist-sizer { - display: inline-block; - position: absolute; - visibility: hidden; - top: 0; - float: left; - .dropdown-menu { - display: block; - min-width: inherit; - } -} \ No newline at end of file diff --git a/less/mixins.less b/less/mixins.less index 51a92d873..9b52fd886 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -110,4 +110,12 @@ a&:hover { color: darken(@color, 10%); } +} + +.vertical-align() { + position: relative; + top: 50%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); } \ No newline at end of file diff --git a/less/selectlist.less b/less/selectlist.less index 7e049c463..b8c3b5c97 100644 --- a/less/selectlist.less +++ b/less/selectlist.less @@ -12,13 +12,17 @@ .dropdown-menu { min-width: inherit; } - .btn.dropdown-toggle { white-space: normal; .selected-label { padding-right: 10px; - text-align: left; + float: left; + } + .caret { + .vertical-align(); + position: absolute; + right: @btnPaddingHorizontal; } } } \ No newline at end of file diff --git a/less/variables.less b/less/variables.less index 61fedc9b6..382648827 100644 --- a/less/variables.less +++ b/less/variables.less @@ -121,6 +121,9 @@ @btnInverseBackground: #444; @btnInverseBackgroundHighlight: @grayDarker; +@btnPaddingVertical: 6px; +@btnPaddingHorizontal: 12px; + // Forms // -------------------------