Skip to content

Commit f3d3d47

Browse files
committed
Merge pull request #32 from pocesar/implicit-globals
code quality improvement
2 parents d4aae99 + c944f26 commit f3d3d47

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

js/jquery.selectric.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
// https://gist.github.com/atesgoral/984375
4141
format = function(f){var a=arguments;return(""+f).replace(/{(\d+|(\w+))}/g,function(s,i,p){return p&&a[1]?a[1][p]:a[i]})},
4242
init = function(element, options) {
43-
var options = $.extend(true, {
43+
options = $.extend(true, {
4444
onOpen: $.noop,
4545
onClose: $.noop,
4646
onChange: $.noop,
@@ -56,8 +56,9 @@
5656
postfixes: 'Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive',
5757
camelCase: true
5858
},
59-
optionsItemBuilder: '{text}', // function(itemData, element, index)
60-
}, options),
59+
optionsItemBuilder: '{text}' // function(itemData, element, index)
60+
}, options);
61+
var
6162
customClass = options.customClass,
6263
postfixes = customClass.postfixes.split(' '),
6364
arrClasses = [],
@@ -66,7 +67,7 @@
6667
if (options.disableOnMobile && /android|ip(hone|od|ad)/i.test(navigator.userAgent)) return;
6768

6869
// generate classNames for elements
69-
while (currPostfix = postfixes.shift()){
70+
while ((currPostfix = postfixes.shift())){
7071
var c = customClass.prefix + currPostfix;
7172
arrClasses.push(customClass.camelCase ? c : c.replace(/([A-Z])/g, "-$&").toLowerCase());
7273
}
@@ -100,7 +101,7 @@
100101
$original.wrap('<div class="' + arrClasses[5] + '">');
101102

102103
function _populate() {
103-
var $options = $original.children();
104+
var $options = $original.children(),
104105
_$li = '<ul>',
105106
selectedIndex = $options.filter(':' + selectStr).index();
106107

0 commit comments

Comments
 (0)