<commit_before>;;(function($) {

	$.fn.chosenImage = function(options) {

		return this.each(function() {

			var $select = $(this);

			// 1. Retrieve img-src from data attribute and set as background image using style attr.
			$select.find('option').each(function() {
				if($(this).attr('data-img-src')) {
					var imgSrc = $(this).attr('data-img-src');
					$(this).css(cssObj(imgSrc));
				}
			});


			// 2. Execute chosen plugin
			$select.chosen(options);


			// 3. Change chosen selected element when form changes
			var  chzn	   = '#' + $select.attr('id') + '_chzn',
				$chzn      = $(chzn).addClass('chznImage-container');

			$select.change(function() {
				var imgSrc = ($select.find('option:selected').attr('data-img-src')) 
								? $select.find('option:selected').attr('data-img-src') : '';
				$chzn.find('.chzn-single span').css(cssObj(imgSrc));
			});

			$select.trigger('change');


			// Utilties
			function cssObj(imgSrc) {
				if(imgSrc) {
					return {
						'background-image': 'url(' + imgSrc + ')',
						'background-repeat': 'no-repeat'
					}
				} else {
					return {
						'background-image': 'none'
					}
				}
			}
		});
	}
<commit_msg>Fix to render in Firefox<commit_after>;;(function($) {

    $.fn.chosenImage = function(options) {

        return this.each(function() {

            var $select = $(this),
                imgMap  = {};

            // 1. Retrieve img-src from data attribute and build object of image sources for each list item
            $select.find('option').each(function(i) {
                    var imgSrc   = $(this).attr('data-img-src');
                    imgMap[i]    = imgSrc;
            });


            // 2. Execute chosen plugin
            $select.chosen(options);

            var  chzn      = '#' + $select.attr('id') + '_chzn',
                $chzn      = $(chzn).addClass('chznImage-container');


            // 3. Style lis with image sources
            $chzn.find('.chzn-results li').each(function(i) {
                $(this).css(cssObj(imgMap[i]));
            });


            // 4. Change image on chosen selected element when form changes
            $select.change(function() {
                var imgSrc = ($select.find('option:selected').attr('data-img-src')) 
                                ? $select.find('option:selected').attr('data-img-src') : '';
                $chzn.find('.chzn-single span').css(cssObj(imgSrc));
            });

            $select.trigger('change');


            // Utilties
            function cssObj(imgSrc) {
                if(imgSrc) {
                    return {
                        'background-image': 'url(' + imgSrc + ')',
                        'background-repeat': 'no-repeat'
                    }
                } else {
                    return {
                        'background-image': 'none'
                    }
                }
            }
        });
    }

{'fraction_non_alphanumeric': 0.16347469220246238, 'fraction_numerical': 0.0023939808481532147, 'mean_word_length': 1.6398916967509025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6253931', 'n_tokens_mistral': 984, 'n_tokens_neox': 832, 'n_words': 156}