Skip to content

Commit 06a7079

Browse files
committed
Merge pull request #1 from gs-akhan/master
Update from original
2 parents 0997207 + e75c05b commit 06a7079

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/jquery.multiselect.filter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
var _self = this;
6464

6565
// do not include hidden elems if the menu isn't open.
66-
var selector = instance._isOpen ? ':disabled, :hidden' : ':disabled';
66+
var selector = _self._isOpen ? ':disabled, :hidden' : ':disabled';
6767

6868
$inputs = $inputs
6969
.not(selector)
@@ -91,14 +91,14 @@
9191
};
9292

9393
// rebuild cache when multiselect is updated
94-
var doc = $(document).bind('multiselectrefresh', $.proxy(function() {
94+
var doc = $(document).bind('multiselectrefresh.'+ instance._namespaceID, $.proxy(function() {
9595
this.updateCache();
9696
this._handler();
9797
}, this));
9898

9999
// automatically reset the widget on close?
100100
if(this.options.autoReset) {
101-
doc.bind('multiselectclose', $.proxy(this._reset, this));
101+
doc.bind('multiselectclose.'+ instance._namespaceID, $.proxy(this._reset, this));
102102
}
103103
},
104104

src/jquery.multiselect.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
noneSelectedText: 'Select options',
3737
selectedText: '# selected',
3838
selectedList: 0,
39+
closeIcon: 'ui-icon ui-icon-circle-close',
3940
show: null,
4041
hide: null,
4142
autoOpen: false,
@@ -86,7 +87,7 @@
8687
return '';
8788
}
8889
})
89-
.append('<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="ui-icon ui-icon-circle-close"></span></a></li>')
90+
.append('<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="'+o.closeIcon+'"></span></a></li>')
9091
.appendTo(header),
9192

9293
checkboxContainer = (this.checkboxContainer = $('<ul />'))
@@ -417,7 +418,7 @@
417418
// restored to their defaultValue prop on form reset, and the reset
418419
// handler fires before the form is actually reset. delaying it a bit
419420
// gives the form inputs time to clear.
420-
$(this.element[0].form).bind('reset.multiselect', function() {
421+
$(this.element[0].form).bind('reset.' + this._namespaceID, function() {
421422
setTimeout($.proxy(self.refresh, self), 10);
422423
});
423424
},
@@ -438,7 +439,8 @@
438439
// set menu width
439440
_setMenuWidth: function() {
440441
var m = this.menu;
441-
m.outerWidth(this.button.outerWidth());
442+
var width = (this.button.outerWidth() <= 0) ? this.options.minWidth : this.button.outerWidth();
443+
m.outerWidth(width);
442444
},
443445

444446
// move up or down within the menu
@@ -644,6 +646,7 @@
644646

645647
// unbind events
646648
$doc.unbind(this._namespaceID);
649+
$(this.element[0].form).unbind(this._namespaceID);
647650

648651
this.button.remove();
649652
this.menu.remove();

0 commit comments

Comments
 (0)