(function ($) {
	$(function() {
		$( '.mc-api-controls button' ).on( 'click', function(e) {
			var controls = $( this ).attr( 'data-controls' );
			var selected = $( this ).attr( 'aria-expanded' );
			
			if ( selected == 'false' ) {
				$( this ).attr( 'aria-expanded', 'true' );
				$( this ).children( 'span' ).removeClass( 'dashicons-minus' ).addClass( 'dashicons-plus' );
				$( '.' + controls ).hide();
			} else {
				$( this ).attr( 'aria-expanded', 'false' );	
				$( this ).children( 'span' ).removeClass( 'dashicons-plus' ).addClass( 'dashicons-minus' );
				$( '.' + controls ).show();
			}
		});
    });
}(jQuery));