|
655 | 655 | module.exports = factory( |
656 | 656 | require('jquery'), |
657 | 657 | require('sifter'), |
658 | | - require('microplugin') |
| 658 | + require('microplugin'), |
659 | 659 | ); |
660 | 660 | } else { |
661 | 661 | root.Selectize = factory(root.jQuery, root.Sifter, root.MicroPlugin); |
|
722 | 722 | for (var i = 0; i < this._events[event].length; i++) { |
723 | 723 | this._events[event][i].apply( |
724 | 724 | this, |
725 | | - Array.prototype.slice.call(arguments, 1) |
| 725 | + Array.prototype.slice.call(arguments, 1), |
726 | 726 | ); |
727 | 727 | } |
728 | 728 | }, |
|
1288 | 1288 | if (!self.settings.splitOn && self.settings.delimiter) { |
1289 | 1289 | var delimiterEscaped = self.settings.delimiter.replace( |
1290 | 1290 | /[-\/\\^$*+?.()|[\]{}]/g, |
1291 | | - '\\$&' |
| 1291 | + '\\$&', |
1292 | 1292 | ); |
1293 | 1293 | self.settings.splitOn = new RegExp('\\s*' + delimiterEscaped + '+\\s*'); |
1294 | 1294 | } |
|
1392 | 1392 | if (self.isOpen) { |
1393 | 1393 | self.positionDropdown.apply(self, arguments); |
1394 | 1394 | } |
1395 | | - } |
| 1395 | + }, |
1396 | 1396 | ); |
1397 | 1397 | $window.on('mousemove' + eventNS, function () { |
1398 | 1398 | self.ignoreHover = false; |
|
1593 | 1593 | if (self.settings.splitOn) { |
1594 | 1594 | setTimeout(function () { |
1595 | 1595 | var splitInput = $.trim(self.$control_input.val() || '').split( |
1596 | | - self.settings.splitOn |
| 1596 | + self.settings.splitOn, |
1597 | 1597 | ); |
1598 | 1598 | for (var i = 0, n = splitInput.length; i < n; i++) { |
1599 | 1599 | self.createItem(splitInput[i]); |
|
2089 | 2089 | .stop() |
2090 | 2090 | .animate( |
2091 | 2091 | {scrollTop: scroll_bottom}, |
2092 | | - animate ? self.settings.scrollDuration : 0 |
| 2092 | + animate ? self.settings.scrollDuration : 0, |
2093 | 2093 | ); |
2094 | 2094 | } else if (y < scroll) { |
2095 | 2095 | self.$dropdown_content |
2096 | 2096 | .stop() |
2097 | 2097 | .animate( |
2098 | 2098 | {scrollTop: scroll_top}, |
2099 | | - animate ? self.settings.scrollDuration : 0 |
| 2099 | + animate ? self.settings.scrollDuration : 0, |
2100 | 2100 | ); |
2101 | 2101 | } |
2102 | 2102 | } |
|
2110 | 2110 | if (self.settings.mode === 'single') return; |
2111 | 2111 |
|
2112 | 2112 | self.$activeItems = Array.prototype.slice.apply( |
2113 | | - self.$control.children(':not(input)').addClass('active') |
| 2113 | + self.$control.children(':not(input)').addClass('active'), |
2114 | 2114 | ); |
2115 | 2115 | if (self.$activeItems.length) { |
2116 | 2116 | self.hideInput(); |
|
2227 | 2227 | calculateScore = self.settings.score.apply(this, [query]); |
2228 | 2228 | if (typeof calculateScore !== 'function') { |
2229 | 2229 | throw new Error( |
2230 | | - 'Selectize "score" setting must be a function that returns a function' |
| 2230 | + 'Selectize "score" setting must be a function that returns a function', |
2231 | 2231 | ); |
2232 | 2232 | } |
2233 | 2233 | } |
|
2237 | 2237 | self.lastQuery = query; |
2238 | 2238 | result = self.sifter.search( |
2239 | 2239 | query, |
2240 | | - $.extend(options, {score: calculateScore}) |
| 2240 | + $.extend(options, {score: calculateScore}), |
2241 | 2241 | ); |
2242 | 2242 | self.currentResults = result; |
2243 | 2243 | } else { |
|
2345 | 2345 | 'optgroup', |
2346 | 2346 | $.extend({}, self.optgroups[optgroup], { |
2347 | 2347 | html: html_children, |
2348 | | - }) |
2349 | | - ) |
| 2348 | + }), |
| 2349 | + ), |
2350 | 2350 | ); |
2351 | 2351 | } else { |
2352 | 2352 | html.push(groups[optgroup].join('')); |
|
2627 | 2627 | getOption: function (value) { |
2628 | 2628 | return this.getElementWithValue( |
2629 | 2629 | value, |
2630 | | - this.$dropdown_content.find('[data-selectable]') |
| 2630 | + this.$dropdown_content.find('[data-selectable]'), |
2631 | 2631 | ); |
2632 | 2632 | }, |
2633 | 2633 |
|
|
2947 | 2947 | escape_html(self.items[i]) + |
2948 | 2948 | '" selected="selected">' + |
2949 | 2949 | escape_html(label) + |
2950 | | - '</option>' |
| 2950 | + '</option>', |
2951 | 2951 | ); |
2952 | 2952 | } |
2953 | 2953 | if (!options.length && !this.$input.attr('multiple')) { |
|
3112 | 3112 |
|
3113 | 3113 | if (self.$activeItems.length) { |
3114 | 3114 | $tail = self.$control.children( |
3115 | | - '.active:' + (direction > 0 ? 'last' : 'first') |
| 3115 | + '.active:' + (direction > 0 ? 'last' : 'first'), |
3116 | 3116 | ); |
3117 | 3117 | caret = self.$control.children(':not(input)').index($tail); |
3118 | 3118 | if (direction > 0) { |
|
3393 | 3393 | id = data[self.settings.optgroupValueField] || ''; |
3394 | 3394 | html = html.replace( |
3395 | 3395 | regex_tag, |
3396 | | - '<$1 data-group="' + escape_replace(escape_html(id)) + '"' |
| 3396 | + '<$1 data-group="' + escape_replace(escape_html(id)) + '"', |
3397 | 3397 | ); |
3398 | 3398 | } |
3399 | 3399 | if (templateName === 'option' || templateName === 'item') { |
3400 | 3400 | html = html.replace( |
3401 | 3401 | regex_tag, |
3402 | | - '<$1 data-value="' + escape_replace(escape_html(value || '')) + '"' |
| 3402 | + '<$1 data-value="' + escape_replace(escape_html(value || '')) + '"', |
3403 | 3403 | ); |
3404 | 3404 | } |
3405 | 3405 |
|
|
3687 | 3687 |
|
3688 | 3688 | instance = new Selectize( |
3689 | 3689 | $input, |
3690 | | - $.extend(true, {}, defaults, settings_element, settings_user) |
| 3690 | + $.extend(true, {}, defaults, settings_element, settings_user), |
3691 | 3691 | ); |
3692 | 3692 | }); |
3693 | 3693 | }; |
|
3781 | 3781 | ); |
3782 | 3782 | }, |
3783 | 3783 | }, |
3784 | | - options |
| 3784 | + options, |
3785 | 3785 | ); |
3786 | 3786 |
|
3787 | 3787 | self.setup = (function () { |
|
3802 | 3802 | equalizeWidth: true, |
3803 | 3803 | equalizeHeight: true, |
3804 | 3804 | }, |
3805 | | - options |
| 3805 | + options, |
3806 | 3806 | ); |
3807 | 3807 |
|
3808 | 3808 | this.getAdjacentOption = function ($option, direction) { |
|
3903 | 3903 | className: 'remove', |
3904 | 3904 | append: true, |
3905 | 3905 | }, |
3906 | | - options |
| 3906 | + options, |
3907 | 3907 | ); |
3908 | 3908 |
|
3909 | 3909 | var self = this; |
|
0 commit comments