<?php
class Nevo_Customizer_Control_Select extends Nevo_Customizer_Control_Base {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-nevo-select">';
		self::before_field();
		?>
		<?php echo self::field_header(); ?>
		<div class="nevo-field-settings-inner">
			<select class="nevo-input" data-name="{{ field.name }}" <# if ( field.multiple ) { #> multiple style="height:100px;"<# } #>>
				<# _.each( field.choices, function( label, key ) { #>
					<option <# if ( field.multiple && Array.isArray( field.value ) && field.value.length > 0 && field.value.indexOf( key ) !== -1 ) { #>  selected(in_array( key, field.value )) <# } else if ( !field.multiple && field.value == key ) { #> selected="selected" <# } #> value="{{ key }}">{{ label }}</option>
				<# } ); #>
			</select>
		</div>
		<?php
		self::after_field();
		echo '</script>';
	}
}
/* <select class="nevo-input" data-name="{{ field.name }}">
				<# _.each( field.choices, function( label, key ){  #>
					<option <# if ( field.multiple && Array.isArray( field.value ) && field.value.length > 0 && field.value.indexOf( key ) !== -1 ) { #> selected="<?php echo in_array(key, field.value) ? 'selected' : ''; ?>" <# } else if ( !field.multiple && field.value == key ) { #> selected="selected" <# } #> value="{{ key }}">{{ label }}</option>
					
					<option <# if ( field.value == key ){ #> selected="selected" <# } #> value="{{ key }}">{{ label }}</option>
				<# } ); #>
			</select> */