File "select.js"

Full Path: /home/jlklyejr/public_html/post-date/wp-content/plugins/meta-box/js/select.js
File size: 536 bytes
MIME-type: text/plain
Charset: utf-8

( function ( $, rwmb ) {
	'use strict';

	function toggleAll( e ) {
		e.preventDefault();

		var $this = $( this ),
			$select = $this.parent().siblings( 'select' );

		if ( 'none' === $this.data( 'type' ) ) {
			$select.val( [] ).trigger( 'change' );
			return;
		}
		var selected = [];
		$select.find( 'option' ).each( function ( index, option ) {
			selected.push( option.value );
		} );
		$select.val( selected ).trigger( 'change' );
	};

	rwmb.$document
		.on( 'click', '.rwmb-select-all-none a', toggleAll );
} )( jQuery, rwmb );