Skip to content

Commit b8d0a58

Browse files
SteveTheTechieHarris
authored andcommitted
Add ability to specify width of filter input
Supports same variety of units as the main widget dimentions
1 parent 10ddd8a commit b8d0a58

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/jquery.multiselect.filter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@
9393
placeholder: opts.placeholder,
9494
type: "search"
9595
})
96-
.css({ width: (/\d/.test(opts.width) ? opts.width + 'px' : null) });
96+
.css({ width: (typeof opts.width === 'string')
97+
? this.instance._parse2px(opts.width, this.$header).px + 'px'
98+
: (/\d/.test(opts.width) ? opts.width + 'px' : null)
99+
});
97100
this._bindInputEvents();
98101
// automatically reset the widget on close?
99102
if (this.options.autoReset) {

0 commit comments

Comments
 (0)