Skip to content

Commit a326bb9

Browse files
committed
Merge pull request #56 from egavrilov/master
Fix #55. Add option for disable class overwriting.
2 parents 7941c8d + 2059807 commit a326bb9

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,13 @@ $(function(){
326326
<td>customClass</td>
327327
<td>{
328328
&nbsp;&nbsp;prefix: 'selectric',
329-
&nbsp;&nbsp;postfixes: 'Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive',
330-
&nbsp;&nbsp;camelCase: true
329+
&nbsp;&nbsp;postfixes: 'Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive Above Scroll',
330+
&nbsp;&nbsp;camelCase: true,
331+
&nbsp;&nbsp;overwrite: true
331332
}</td>
332333
<td>Object</td>
333334
<td>Custom classes.
334-
Every class in 'postfixes' should be separate with a space and follow this exact order: 'Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive'</td>
335+
Every class in 'postfixes' should be separate with a space and follow this exact order: 'Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive Above Scroll'</td>
335336
</tr>
336337
<tr>
337338
<td>optionsItemBuilder</td>

dist/jquery.selectric.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* /,'
1010
* /'
1111
*
12-
* Selectric Ϟ v1.8.5 (2014-10-02) - http://lcdsantos.github.io/jQuery-Selectric/
12+
* Selectric Ϟ v1.8.6 (2014-10-14) - http://lcdsantos.github.io/jQuery-Selectric/
1313
*
1414
* Copyright (c) 2014 Leonardo Santos; Dual licensed: MIT/GPL
1515
*
@@ -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;

dist/jquery.selectric.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)