Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Suit bootstrap for paladin
Browse files Browse the repository at this point in the history
  • Loading branch information
marostr committed Jun 16, 2016
1 parent db6559c commit acbd751
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
// initialize object and result
r=[];
// iterate over object keys
for (k in o)
for (k in o)
// fill result array with non-prototypical keys
r.hasOwnProperty.call(o, k) && r.push(k);
// return result
Expand Down Expand Up @@ -356,15 +356,15 @@
this.$newElement.on('hide.bs.dropdown', function (e) {
that.$element.trigger('hide.bs.select', e);
});

this.$newElement.on('hidden.bs.dropdown', function (e) {
that.$element.trigger('hidden.bs.select', e);
});

this.$newElement.on('show.bs.dropdown', function (e) {
that.$element.trigger('show.bs.select', e);
});

this.$newElement.on('shown.bs.dropdown', function (e) {
that.$element.trigger('shown.bs.select', e);
});
Expand Down Expand Up @@ -516,7 +516,7 @@
// Get the class and text for the option
var optionClass = this.className || '',
inline = this.style.cssText,
text = $this.data('content') ? $this.data('content') : $this.html(),
text = $this.data('content') ? $this.data('content') : $this.text(),
tokens = $this.data('tokens') ? $this.data('tokens') : null,
subtext = typeof $this.data('subtext') !== 'undefined' ? '<small class="text-muted">' + $this.data('subtext') + '</small>' : '',
icon = typeof $this.data('icon') !== 'undefined' ? '<span class="' + that.options.iconBase + ' ' + $this.data('icon') + '"></span> ' : '',
Expand Down Expand Up @@ -546,7 +546,7 @@
var label = this.parentElement.label,
labelSubtext = typeof $this.parent().data('subtext') !== 'undefined' ? '<small class="text-muted">' + $this.parent().data('subtext') + '</small>' : '',
labelIcon = $this.parent().data('icon') ? '<span class="' + that.options.iconBase + ' ' + $this.parent().data('icon') + '"></span> ' : '';

label = labelIcon + '<span class="text">' + label + labelSubtext + '</span>';

if (index !== 0 && _li.length > 0) { // Is it NOT the first option of the select && are there elements in the dropdown?
Expand Down Expand Up @@ -622,7 +622,7 @@
} else if ($this.data('content') && that.options.showContent) {
return $this.data('content');
} else {
return icon + $this.html() + subtext;
return icon + $this.text() + subtext;
}
}
}).toArray();
Expand Down Expand Up @@ -738,8 +738,8 @@
parseInt(menuStyle ? menuStyle.paddingBottom : $menu.css('paddingBottom')) +
parseInt(menuStyle ? menuStyle.borderTopWidth : $menu.css('borderTopWidth')) +
parseInt(menuStyle ? menuStyle.borderBottomWidth : $menu.css('borderBottomWidth')),
menuExtras = menuPadding +
parseInt(menuStyle ? menuStyle.marginTop : $menu.css('marginTop')) +
menuExtras = menuPadding +
parseInt(menuStyle ? menuStyle.marginTop : $menu.css('marginTop')) +
parseInt(menuStyle ? menuStyle.marginBottom : $menu.css('marginBottom')) + 2;

document.body.removeChild(newElement);
Expand Down Expand Up @@ -1004,7 +1004,7 @@
});

$document.data('spaceSelect', false);

this.$button.on('keyup', function (e) {
if (/(32)/.test(e.keyCode.toString(10)) && $document.data('spaceSelect')) {
e.preventDefault();
Expand All @@ -1021,7 +1021,7 @@
var selectedIndex = that.liObj[that.$element[0].selectedIndex];

if (typeof selectedIndex !== 'number' || that.options.size === false) return;

// scroll to selected option
var offset = that.$lis.eq(selectedIndex)[0].offsetTop - that.$menuInner[0].offsetTop;
offset = offset - that.$menuInner[0].offsetHeight/2 + that.sizeInfo.liHeight/2;
Expand Down

0 comments on commit acbd751

Please sign in to comment.