|
10 | 10 | */
|
11 | 11 |
|
12 | 12 | if (typeof jQuery === 'undefined') {
|
13 |
| - throw new Error("Mobileselect' requires jQuery"); |
| 13 | + throw new Error('Mobileselect requires jQuery'); |
14 | 14 | }
|
15 | 15 |
|
16 | 16 | (function($) {
|
@@ -70,7 +70,9 @@ if (typeof jQuery === 'undefined') {
|
70 | 70 | //reject non SELECT elements
|
71 | 71 | if ($elm[0].tagName !== 'SELECT') {
|
72 | 72 | console.warn(
|
73 |
| - 'Sorry, cannot initialized a ' + $elm[0].tagName + ' element' |
| 73 | + 'Sorry, cannot initialized a ' + |
| 74 | + $elm[0].tagName + |
| 75 | + ' element' |
74 | 76 | );
|
75 | 77 | return true;
|
76 | 78 | // continue;
|
@@ -143,7 +145,8 @@ if (typeof jQuery === 'undefined') {
|
143 | 145 | this.$c
|
144 | 146 | .children('div')
|
145 | 147 | .css({
|
146 |
| - '-webkit-transition': 'all ' + this.animationSpeed / 1000 + 's', |
| 148 | + '-webkit-transition': |
| 149 | + 'all ' + this.animationSpeed / 1000 + 's', |
147 | 150 | transition: 'all ' + this.animationSpeed / 1000 + 's'
|
148 | 151 | })
|
149 | 152 | .css(this.padding)
|
@@ -180,19 +183,24 @@ if (typeof jQuery === 'undefined') {
|
180 | 183 | this.$listcontainer.html('');
|
181 | 184 | var that = this;
|
182 | 185 | var prevGroup = '';
|
| 186 | + var b = ''; |
183 | 187 | console.log(this.options);
|
184 | 188 | $.each(this.options, function(i, a) {
|
185 | 189 | if (a.group && a.group !== prevGroup) {
|
186 | 190 | if (a.groupDisabled) {
|
187 |
| - var b = 'disabled'; |
| 191 | + b = 'disabled'; |
188 | 192 | }
|
189 | 193 | that.$listcontainer.append(
|
190 |
| - '<span class="mobileSelect-group" ' + b + '>' + a.group + '</span>' |
| 194 | + '<span class="mobileSelect-group" ' + |
| 195 | + b + |
| 196 | + '>' + |
| 197 | + a.group + |
| 198 | + '</span>' |
191 | 199 | );
|
192 | 200 | prevGroup = a.group;
|
193 | 201 | }
|
194 | 202 | if (a.groupDisabled || a.disabled) {
|
195 |
| - var b = 'disabled'; |
| 203 | + b = 'disabled'; |
196 | 204 | }
|
197 | 205 | that.$listcontainer.append(
|
198 | 206 | '<a href="#" class="mobileSelect-control" ' +
|
@@ -416,12 +424,11 @@ if (typeof jQuery === 'undefined') {
|
416 | 424 | if ($t.text()) {
|
417 | 425 | // var label = $t.parent().is('optgroup') ? $t.parent().attr('label') : false;
|
418 | 426 |
|
| 427 | + var label = false; |
| 428 | + var labelDisabled = false; |
419 | 429 | if ($t.parent().is('optgroup')) {
|
420 |
| - var label = $t.parent().attr('label'); |
421 |
| - var labelDisabled = $t.parent().prop('disabled'); |
422 |
| - } else { |
423 |
| - var label = false; |
424 |
| - var labelDisabled = false; |
| 430 | + label = $t.parent().attr('label'); |
| 431 | + labelDisabled = $t.parent().prop('disabled'); |
425 | 432 | }
|
426 | 433 | console.log($t.val());
|
427 | 434 | options.push({
|
@@ -509,5 +516,6 @@ if (typeof jQuery === 'undefined') {
|
509 | 516 | onClose: function() {},
|
510 | 517 | style: 'btn-default'
|
511 | 518 | };
|
| 519 | + // eslint-disable-next-line no-undef |
512 | 520 | })(jQuery);
|
513 | 521 | //<form class="form-inline"><input class="form-control" type="search" placeholder="Search" aria-label="Search"></form>
|
0 commit comments