PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 3.16.3
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v3.16.3
4.0.3 4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 341 releases
profile-builder / front-end / default-fields / select2 / select2.js

select2.js in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 3.16.3, at front-end/default-fields/select2/select2.js

27 lines 942 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1
2 /**
3 * Function that initializes select2 on fields
4 *
5 * @since v.3.3.4
6 */
7 function wppb_select2_initialize() {
8 jQuery ( '.custom_field_select2' ).each( function(){
9 var selectElement = jQuery( this );
10 var arguments = wp.hooks.applyFilters( 'wppb_select2_initialize_arguments', arguments, selectElement );
11
12 if ( !( 'placeholder' in arguments ) || arguments.placeholder === '' ) {
13 arguments.placeholder = jQuery('label[for="' + selectElement.attr('id') + '"]').text();
14 }
15
16 selectElement.select2( arguments ).on('select2:open', function(){
17 // compatibility with Divi Overlay
18 if( jQuery(selectElement).parents( '.overlay-container' ).length ){
19 jQuery(selectElement).data('select2').dropdown.$dropdownContainer.css( 'z-index', '99999999' );
20 }
21 });
22 });
23 }
24
25 jQuery( document ).ready(function() {
26 wppb_select2_initialize();
27 });