summaryrefslogtreecommitdiffstats
path: root/jquery.multiple.select.js
diff options
context:
space:
mode:
Diffstat (limited to 'jquery.multiple.select.js')
-rw-r--r--jquery.multiple.select.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/jquery.multiple.select.js b/jquery.multiple.select.js
index de87c65..83a74d8 100644
--- a/jquery.multiple.select.js
+++ b/jquery.multiple.select.js
@@ -11,8 +11,12 @@
function MultipleSelect($el, options) {
var that = this,
- name = $el.attr('name') || options.name || '',
- elWidth = $el.outerWidth();
+ name = $el.attr('name') || options.name || ''
+
+ $el.parent().hide();
+ var elWidth = $el.css("width");
+ $el.parent().show();
+ if (elWidth=="0px") {elWidth = $el.outerWidth()+20}
this.$el = $el.hide();
this.options = options;
@@ -93,6 +97,7 @@
this.$disableItems = this.$drop.find('input[' + this.selectItemName + ']:disabled');
this.$noResults = this.$drop.find('.ms-no-results');
this.events();
+ this.updateSelectAll(true);
this.update(true);
if (this.options.isOpen) {
@@ -343,8 +348,9 @@
}
},
- updateSelectAll: function () {
- var $items = this.$selectItems.filter(':visible');
+ updateSelectAll: function (Init) {
+ var $items = this.$selectItems;
+ if (!Init) { $items = $items.filter(':visible'); }
this.$selectAll.prop('checked', $items.length &&
$items.length === $items.filter(':checked').length);
if (this.$selectAll.prop('checked')) {