Skip to content

Commit

Permalink
Merge pull request #203 from caseyjhol/master
Browse files Browse the repository at this point in the history
Allow inline styles on options
  • Loading branch information
caseyjhol committed Jul 9, 2013
2 parents dfc5fc7 + aef8caa commit c41d35a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

//Get the class and text for the option
var optionClass = $this.attr("class") || '';
var inline = $this.attr("style") || '';
var text = $this.html();
var subtext = $this.data('subtext') !== undefined ? '<small class="muted">' + $this.data('subtext') + '</small>' : '';
var icon = $this.data('icon') !== undefined ? '<i class="'+$this.data('icon')+'"></i> ' : '';
Expand All @@ -137,22 +138,22 @@
_liA.push(
'<div class="div-contain"><div class="divider"></div></div>'+
'<dt>'+label+'</dt>'+
_this.createA(text, "opt " + optionClass )
_this.createA(text, "opt " + optionClass, inline )
);
} else {
_liA.push(
'<dt>'+label+'</dt>'+
_this.createA(text, "opt " + optionClass ));
_this.createA(text, "opt " + optionClass, inline ));
}
} else {
_liA.push( _this.createA(text, "opt " + optionClass ) );
_liA.push( _this.createA(text, "opt " + optionClass, inline ) );
}
} else if ($this.data('divider') == true) {
_liA.push('<div class="div-contain"><div class="divider"></div></div>');
} else if ($(this).data('hidden') == true) {
_liA.push('');
} else {
_liA.push( _this.createA(text, optionClass ) );
_liA.push( _this.createA(text, optionClass, inline ) );
}
});

Expand All @@ -168,8 +169,8 @@
return $(_liHtml);
},

createA: function(text, classes) {
return '<a tabindex="0" class="'+classes+'">' +
createA: function(text, classes, inline) {
return '<a tabindex="0" class="'+classes+'" style="'+inline+'">' +
text +
'<i class="icon-ok check-mark"></i>' +
'</a>';
Expand Down
Loading

0 comments on commit c41d35a

Please sign in to comment.