Skip to content

Commit

Permalink
Merge pull request #508 from caseyjhol/master
Browse files Browse the repository at this point in the history
Fix #507
  • Loading branch information
caseyjhol committed Mar 8, 2014
2 parents 7059ce4 + 6c5e08e commit ad009c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions bootstrap-select.js
Expand Up @@ -192,7 +192,7 @@

$.each(_liA, function(i, item) {
var hide = item === '<a></a>' ? 'class="hide"' : '';
_liHtml += '<li rel=' + i + '>' + item + '</li>';
_liHtml += '<li rel="' + i + '"' + hide + '>' + item + '</li>';
});

//If we are not multiple, and we dont have a selected item, and we dont have a title, select the first element so something is set in the button
Expand Down Expand Up @@ -457,12 +457,12 @@
},

setSelected: function(index, selected) {
if (this.$lis == null) this.$lis = this.$menu.find('li');
if (this.$lis == null) this.$lis = this.$menu.find('li:not(.hide)');
$(this.$lis[index]).toggleClass('selected', selected);
},

setDisabled: function(index, disabled) {
if (this.$lis == null) this.$lis = this.$menu.find('li');
if (this.$lis == null) this.$lis = this.$menu.find('li:not(.hide)');
if (disabled) {
$(this.$lis[index]).addClass('disabled').find('a').attr('href', '#').attr('tabindex', -1);
} else {
Expand Down Expand Up @@ -963,4 +963,4 @@
.on('keydown', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bootstrap-select-searchbox input', Selectpicker.prototype.keydown)
.on('focusin.modal', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bootstrap-select-searchbox input', function (e) { e.stopPropagation(); });

}(window.jQuery);
}(window.jQuery);

0 comments on commit ad009c8

Please sign in to comment.