Files
nurinda.co.id---old/wp-content/plugins/mashsharer/includes/admin/meta-box/js/image-select.js
T

27 lines
567 B
JavaScript

jQuery( function ( $ )
{
'use strict';
$( 'body' ).on( 'change', '.mashsb-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( 'mashsb-rwmb-active' );
if ( type === 'radio' )
{
$others.removeClass( 'mashsb-rwmb-active' );
}
}
else
{
$parent.removeClass( 'mashsb-rwmb-active' );
}
} );
$( '.mashsb-rwmb-image-select input' ).trigger( 'change' );
} );