Skip to content

Commit

Permalink
Select tags minimum size attribute set to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierfaucon committed Apr 29, 2015
1 parent 46b0ed9 commit af49307
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions bootstrap-selectsplitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@
$(this).find('option').each(function() {
self.fullCategoryList[$that.attr('label')][$(this).attr('value')] = $(this).text();
currentOptionCount++;


});

if (currentOptionCount > longestOptionCount) { longestOptionCount = currentOptionCount ;}

optgroupCount++;
});

Expand All @@ -78,12 +77,12 @@

// Define selected elements.
self.$wrapper = $('div[data-selectsplitter-wrapper-selector]');
console.log(self.$wrapper);

self.$firstSelect = $('div[data-selectsplitter-wrapper-selector] select[data-selectsplitter-firstselect-selector]');
self.$secondSelect = $('div[data-selectsplitter-wrapper-selector] select[data-selectsplitter-secondselect-selector]');

// Define $firstSelect and $secondSelect size attribute
var selectSize = Math.max(optgroupCount, longestOptionCount);
var selectSize = Math.max(optgroupCount, longestOptionCount, 2);
selectSize = Math.min(selectSize, 10);
self.$firstSelect.attr('size', selectSize);
self.$secondSelect.attr('size', selectSize);
Expand Down
2 changes: 1 addition & 1 deletion bootstrap-selectsplitter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit af49307

Please sign in to comment.