controlgroup only gets innerwrapped if there's a controlgroup label (legend element)

This commit is contained in:
scottjehl 2010-10-05 18:34:41 -04:00
parent 9ccead23b6
commit 82c041b23d

View file

@ -16,10 +16,9 @@ $.fn.controlgroup = function(options){
flCorners = o.direction == 'horizontal' ? ['ui-corner-left', 'ui-corner-right'] : ['ui-corner-top', 'ui-corner-bottom'],
type = $(this).find('input:eq(0)').attr('type');
$(this).wrapInner('<div class="ui-controlgroup-controls"></div>');
//replace legend with more stylable replacement div
if( groupheading.length ){
$(this).wrapInner('<div class="ui-controlgroup-controls"></div>');
$('<div role="heading" class="ui-controlgroup-label">'+ groupheading.html() +'</div>').insertBefore( $(this).children(0) );
groupheading.remove();
}