Skip to content

Commit

Permalink
move checkMark creation into buildList function
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyjhol committed Oct 16, 2019
1 parent 1dd797b commit 47e8d65
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1445,11 +1445,6 @@

if (this.options.hideDisabled) optionSelector += ':not(:disabled)';

if ((that.options.showTick || that.multiple) && !elementTemplates.checkMark.parentNode) {
elementTemplates.checkMark.className = iconBase + ' ' + that.options.tickIcon + ' check-mark';
elementTemplates.a.appendChild(elementTemplates.checkMark);
}

var selectOptions = this.$element[0].querySelectorAll('select > *' + optionSelector);

function addDivider (config) {
Expand Down Expand Up @@ -1580,6 +1575,11 @@
mainElements = [],
widestOptionLength = 0;

if ((that.options.showTick || that.multiple) && !elementTemplates.checkMark.parentNode) {
elementTemplates.checkMark.className = this.options.iconBase + ' ' + that.options.tickIcon + ' check-mark';
elementTemplates.a.appendChild(elementTemplates.checkMark);
}

function buildElement (item) {
var liElement,
combinedLength = 0;
Expand Down

0 comments on commit 47e8d65

Please sign in to comment.