| @@ -45,12 +45,9 @@ | ||
| 45 | 45 | protected function get_default_settings() { |
| 46 | 46 | return [ |
| 47 | 47 | 'options' => [], |
| 48 | 48 | 'multiple' => false, |
| 49 | - // Select2 library options | |
| 50 | 49 | 'select2options' => [], |
| 51 | - // the lockedOptions array can be passed option keys. The passed option keys will be non-deletable. | |
| 52 | - 'lockedOptions' => [], | |
| 53 | 50 | ]; |
| 54 | 51 | } |
| 55 | 52 | |
| 56 | 53 | /** |
| @@ -63,16 +60,17 @@ | ||
| 63 | 60 | * @since 1.0.0 |
| 64 | 61 | * @access public |
| 65 | 62 | */ |
| 66 | 63 | public function content_template() { |
| 64 | + $control_uid = $this->get_control_uid(); | |
| 67 | 65 | ?> |
| 68 | 66 | <div class="elementor-control-field"> |
| 69 | 67 | <# if ( data.label ) {#> |
| 70 | - <label for="<?php $this->print_control_uid(); ?>" class="elementor-control-title">{{{ data.label }}}</label> | |
| 68 | + <label for="<?php echo $control_uid; ?>" class="elementor-control-title">{{{ data.label }}}</label> | |
| 71 | 69 | <# } #> |
| 72 | 70 | <div class="elementor-control-input-wrapper elementor-control-unit-5"> |
| 73 | 71 | <# var multiple = ( data.multiple ) ? 'multiple' : ''; #> |
| 74 | - <select id="<?php $this->print_control_uid(); ?>" class="elementor-select2" type="select2" {{ multiple }} data-setting="{{ data.name }}"> | |
| 72 | + <select id="<?php echo $control_uid; ?>" class="elementor-select2" type="select2" {{ multiple }} data-setting="{{ data.name }}"> | |
| 75 | 73 | <# _.each( data.options, function( option_title, option_value ) { |
| 76 | 74 | var value = data.controlValue; |
| 77 | 75 | if ( typeof value == 'string' ) { |
| 78 | 76 | var selected = ( option_value === value ) ? 'selected' : ''; |
| @@ -80,9 +78,9 @@ | ||
| 80 | 78 | var value = _.values( value ); |
| 81 | 79 | var selected = ( -1 !== value.indexOf( option_value ) ) ? 'selected' : ''; |
| 82 | 80 | } |
| 83 | 81 | #> |
| 84 | - <option {{ selected }} value="{{ _.escape( option_value ) }}">{{{ _.escape( option_title ) }}}</option> | |
| 82 | + <option {{ selected }} value="{{ option_value }}">{{{ option_title }}}</option> | |
| 85 | 83 | <# } ); #> |
| 86 | 84 | </select> |
| 87 | 85 | </div> |
| 88 | 86 | </div> |