HEX
Server: LiteSpeed
System: Linux sg-cp4.cloudnetwork.vn 4.18.0-553.69.1.lve.el8.x86_64 #1 SMP Wed Aug 13 19:53:59 UTC 2025 x86_64
User: thu28850 (1134)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/thu28850/www/wp-content/plugins/meta-box/js/image-select.js
( function ( $, rwmb ) {
	'use strict';

	function setActiveClass() {
		var $this = $( this ),
			type = $this.attr( 'type' ),
			selected = $this.is( ':checked' ),
			$parent = $this.parent(),
			$others = $parent.siblings();
		if ( selected ) {
			$parent.addClass( 'rwmb-active' );
			if ( type === 'radio' ) {
				$others.removeClass( 'rwmb-active' );
			}
		} else {
			$parent.removeClass( 'rwmb-active' );
		}
	}

	function init( e ) {
		$( e.target ).find( '.rwmb-image-select input' ).trigger( 'change' );
	}

	rwmb.$document
		.on( 'mb_ready', init )
		.on( 'change', '.rwmb-image-select input', setActiveClass );
} )( jQuery, rwmb );