Skip to content

Instantly share code, notes, and snippets.

@alfredobarron
Created August 19, 2015 21:59
Show Gist options
  • Save alfredobarron/ee219114977c398f8cef to your computer and use it in GitHub Desktop.
Save alfredobarron/ee219114977c398f8cef to your computer and use it in GitHub Desktop.
width 100% in bootstrap 3 into tabs
/**
* Change line 4927
*/
Select2.prototype._resolveWidth = function ($element, method) {
var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
if (method == 'resolve') {
var styleWidth = this._resolveWidth($element, 'style');
if (styleWidth != null) {
return styleWidth;
}
return this._resolveWidth($element, 'element');
}
if (method == 'element') {
var elementWidth = $element.outerWidth(false);
if (elementWidth <= 0) {
return 'auto';
}
//return elementWidth + 'px';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment