summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Cohen Gindi <Danielgindi@gmail.com>2014-12-08 10:41:37 +0200
committerDaniel Cohen Gindi <Danielgindi@gmail.com>2014-12-08 10:41:37 +0200
commitf7153e19fba11109923066d8c8b8cd55c72d8a3f (patch)
tree5ed69c97b6d2104554982b55eb4df7a0fee45c35
parenta7473b5a2dc6a46abf8c09f84b8736d446610d3c (diff)
downloadmultiple-select-f7153e19fba11109923066d8c8b8cd55c72d8a3f.zip
multiple-select-f7153e19fba11109923066d8c8b8cd55c72d8a3f.tar.gz
multiple-select-f7153e19fba11109923066d8c8b8cd55c72d8a3f.tar.bz2
Keep original styling of the parent element
It was previously interfering with css stylesheets.
-rw-r--r--jquery.multiple.select.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/jquery.multiple.select.js b/jquery.multiple.select.js
index 03db7db..a9229aa 100644
--- a/jquery.multiple.select.js
+++ b/jquery.multiple.select.js
@@ -13,9 +13,10 @@
var that = this,
name = $el.attr('name') || options.name || ''
+ var originalParentStyle = $el.parent().attr('style') || '';
$el.parent().hide();
var elWidth = $el.css("width");
- $el.parent().show();
+ $el.parent().show().attr('style', originalParentStyle);
if (elWidth=="0px") {elWidth = $el.outerWidth()+20}
this.$el = $el.hide();