{:uriI"Îfile:///Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts/fae/form/fae_chosen.js?type=application/javascript&pipeline=self&id=758dc725b9242c76aa968c741cd8bb1aef6d8e427223d206ffbc9bde32d86e34:ET:load_pathI"G/Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts;F: filenameI"^/Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts/fae/form/fae_chosen.js;T: nameI"fae/form/fae_chosen;T:logical_pathI" fae/form/fae_chosen.self.js;T:content_typeI"application/javascript;T: sourceI"'(function ( $ ) { 'use strict'; /** * This plugin sets chosen defaults and massages options based on class names. * @function external:"jQuery.fn".fae_chosen */ $.fn.fae_chosen = function( options ) { var defaults = { disable_search_threshold: 10 }; var settings = $.extend( {}, defaults, options ); return this.each(function() { var $this = $(this); // remove threshold if show_search class is added from `search: true` if ($this.hasClass('select-search')) { settings.disable_search_threshold = 0; } $this.chosen(settings); // add handling for bottom of viewport / drop-up support $this.on('chosen:showing_dropdown', function(event, params) { var chosen_container = $(event.target ).next('.chosen-container'); var dropdown = chosen_container.find('.chosen-drop'); var results_container_max_height = parseInt(dropdown.find('.chosen-results').css('max-height')); var results_container_top_offset = 40; // to account for possibility of chosen search input var dropdown_top = dropdown.offset().top - $(window).scrollTop(); var viewport_height = $(window).height(); if (dropdown_top + results_container_max_height + results_container_top_offset > viewport_height) { chosen_container.addClass('chosen-drop-up'); } }); $this.on('chosen:hiding_dropdown', function(event, params) { $(event.target).next('.chosen-container').removeClass('chosen-drop-up'); }); }); }; }( jQuery )); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"lfile-digest:///Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts/fae/form/fae_chosen.js;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%Z6 s©*’|Iö./dáÑ$:idI"E758dc725b9242c76aa968c741cd8bb1aef6d8e427223d206ffbc9bde32d86e34;F: mtimel+ ôW