File "image-select.js"
Full Path: /home/bodycultub/www/wp-admin/tmp/.tmb/js/image-select.js
File size: 522 bytes
MIME-type: text/plain
Charset: utf-8
jQuery( function ( $ ) {
'use strict';
$( 'body' ).on( 'change', '.rwmb-image-select input', function () {
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' );
}
} );
$( '.rwmb-image-select input' ).trigger( 'change' );
} );