File Manager / wp-content Search Upload New Item Settings File "db5.php" Full path: /home1/epichome/public_html/wp-content/db5.php File size: 60.67 B (60.67 KB bytes) MIME-type: text/x-php Charset: utf-8 Download Open Edit Advanced Editor Back
/home/pharmacy/www/wp-content/plugins/so-widgets-bundle/base/inc/fields/js/select-field.js
/* global jQuery */

( function( $ ) {

	$( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-select', function( e ) {
		var $$ = $( this );

		if ( $$.data( 'initialized' ) ) {
			return;
		}

		if ( typeof $.fn.select2 == 'function' ) {
			$$.find( '.sow-select2' ).select2();

			// Prevent gap between dropdown items.
			let listMargin;
			$$.find( '.sow-select2' ).on( 'select2:open', function() {
				setTimeout( function() {
					var $dropdown = $( '.select2-results__option' );
					listMargin = $dropdown.css('margin');
					$dropdown.css('margin', '0');
				}, 1 );
			} );

			$$.find( '.sow-select2' ).on( 'select2:close', function() {
				$( '.select2-results__option' ).css( 'margin', listMargin );
			} );
		}

		$$.data( 'initialized', true );
	} );

} )( jQuery );