Skip to content

Commit b6c9ca5

Browse files
committed
Fix #55. Add option for class overwriting, change replacing classes from pluginName to customClass.prefix
1 parent 7941c8d commit b6c9ca5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

dist/jquery.selectric.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
customClass: {
3636
prefix: pluginName,
3737
postfixes: classList,
38-
camelCase: true
38+
camelCase: true,
39+
overwrite: true
3940
},
4041
optionsItemBuilder: '{text}' // function(itemData, element, index)
4142
},
@@ -204,7 +205,14 @@
204205

205206
$wrapper.add($original).add($outerWrapper).add($input).off(bindSufix);
206207

207-
$outerWrapper.prop('class', [_this.classes.wrapper, $original.prop('class').replace(/\S+/g, pluginName + '-$&'), _this.options.responsive ? _this.classes.responsive : ''].join(' '));
208+
209+
$outerWrapper.prop('class', [
210+
_this.classes.wrapper,
211+
_this.options.customClass.overwrite ?
212+
$original.prop('class').replace(/\S+/g, _this.options.customClass.prefix + '-$&') :
213+
$original.prop('class'),
214+
_this.options.responsive ? _this.classes.responsive : ''
215+
].join(' '));
208216

209217
if ( !$original.prop('disabled') ){
210218
isEnabled = true;

0 commit comments

Comments
 (0)