1/** 2 * Toggle State wrapper. 3 * 4 * @author Htmlstream 5 * @version 1.0 6 * 7 */ 8;(function ($) { 9 'use strict'; 10 $.HSCore.components.HSSelectPicker = { 11 /** 12 * 13 * 14 * @var Object _baseConfig 15 */ 16 _baseConfig: {}, 17 18 /** 19 * 20 * 21 * @var jQuery pageCollection 22 */ 23 pageCollection: $(), 24 25 /** 26 * Initialization of Go To wrapper. 27 * 28 * @param String selector (optional) 29 * @param Object config (optional) 30 * 31 * @return jQuery pageCollection - collection of initialized items. 32 */ 33 34 init: function (selector, config) { 35 this.collection = selector && $(selector).length ? $(selector) : $(); 36 if (!$(selector).length) return; 37 38 this.config = config && $.isPlainObject(config) ? 39 $.extend({}, this._baseConfig, config) : this._baseConfig; 40 41 this.config.itemSelector = selector; 42 43 this.initSelectPicker(); 44 45 return this.pageCollection; 46 }, 47 48 initSelectPicker: function () { 49 //Variables 50 var $self = this, 51 collection = $self.pageCollection; 52 53 //Actions 54 this.collection.each(function (i, el) { 55 //Variables 56 var $this = $(el); 57 58 $this.selectpicker(); 59 60 $this.on('loaded.bs.select', function (e) { 61 var $searchbox = $this.siblings('.dropdown-menu ').find('.bs-searchbox'), 62 searchBoxClasses = $this.data('searchbox-classes'); 63 64 if(!searchBoxClasses) return; 65 66 $searchbox.addClass(searchBoxClasses); 67 }); 68 69 //Actions 70 collection = collection.add($this); 71 }); 72 } 73 }; 74})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.