| @@ -35,34 +35,32 @@ | ||
| 35 | 35 | wp_localize_script( |
| 36 | 36 | 'rtsb-editor-script', |
| 37 | 37 | 'rtSelect2Obj', |
| 38 | 38 | [ |
| 39 | - 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), | |
| 40 | - 'search_text' => esc_html__( 'Please Select', 'shopbuilder' ), | |
| 41 | - 'nonceId' => rtsb()->nonceId, | |
| 42 | - rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ), | |
| 39 | + 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), | |
| 40 | + 'search_text' => esc_html__( 'Please Select', 'textdomain' ), | |
| 43 | 41 | ] |
| 44 | 42 | ); |
| 45 | 43 | ?> |
| 46 | - <style> | |
| 47 | - .rt-select2-main-wrapper ul.select2-selection__rendered li:last-child { | |
| 48 | - pointer-events: none; | |
| 49 | - } | |
| 44 | + <style> | |
| 45 | + .rt-select2-main-wrapper ul.select2-selection__rendered li:last-child { | |
| 46 | + pointer-events: none; | |
| 47 | + } | |
| 50 | 48 | |
| 51 | - .rt-select2-main-wrapper ul.select2-selection__rendered li:last-child::before { | |
| 52 | - background: var(--e-a-btn-bg); | |
| 53 | - content: '+'; | |
| 54 | - padding: 1px 5px; | |
| 55 | - position: relative; | |
| 56 | - top: 1px; | |
| 57 | - margin-right: 5px; | |
| 58 | - color: #fff; | |
| 59 | - } | |
| 49 | + .rt-select2-main-wrapper ul.select2-selection__rendered li:last-child::before { | |
| 50 | + background: var(--e-a-btn-bg); | |
| 51 | + content: '+'; | |
| 52 | + padding: 1px 5px; | |
| 53 | + position: relative; | |
| 54 | + top: 1px; | |
| 55 | + margin-right: 5px; | |
| 56 | + color: #fff; | |
| 57 | + } | |
| 60 | 58 | |
| 61 | - .rt-select2-main-wrapper ul.select2-selection__rendered li[title=search] { | |
| 62 | - display: none; | |
| 63 | - } | |
| 64 | - </style> | |
| 59 | + .rt-select2-main-wrapper ul.select2-selection__rendered li[title=search] { | |
| 60 | + display: none; | |
| 61 | + } | |
| 62 | + </style> | |
| 65 | 63 | <?php |
| 66 | 64 | } |
| 67 | 65 | |
| 68 | 66 | protected function get_default_settings() { |
| @@ -79,27 +77,27 @@ | ||
| 79 | 77 | public function content_template() { |
| 80 | 78 | $control_uid = $this->get_control_uid(); |
| 81 | 79 | ?> |
| 82 | 80 | |
| 83 | - <# var controlUID = '<?php echo esc_html( $control_uid ); ?>'; #> | |
| 84 | - <# var currentID = elementor.panel.currentView.currentPageView.model.attributes.settings.attributes[data.name]; #> | |
| 85 | - <# var maxSelection = (data.maximum_selection_length > 0) ? 'max-select'+data.maximum_selection_length : 'unlimited-select' #> | |
| 86 | - <div class="elementor-control-field rt-select2-main-wrapper {{maxSelection}}"> | |
| 87 | - <# if ( data.label ) { #> | |
| 88 | - <label for="<?php echo esc_attr( $control_uid ); ?>" class="elementor-control-title">{{{data.label }}}</label> | |
| 89 | - <# } #> | |
| 90 | - <div class="elementor-control-input-wrapper elementor-control-unit-5"> | |
| 91 | - <# var multiple = ( data.multiple ) ? 'multiple' : ''; #> | |
| 92 | - <select id="<?php echo esc_attr( $control_uid ); ?>" {{ multiple }} class="rt-select2" data-setting="{{ data.name }}"></select> | |
| 93 | - </div> | |
| 94 | - <# if ( data.description ) { #> | |
| 95 | - <div class="elementor-control-field-description rtsb-description">{{{ data.description }}}</div> | |
| 96 | - <# } #> | |
| 97 | - </div> | |
| 98 | - <# | |
| 99 | - ( function( $ ) { | |
| 100 | - $( document.body ).trigger( 'rt_select2_event',{currentID:data.controlValue,data:data,controlUID:controlUID,multiple:data.multiple} ); | |
| 101 | - }( jQuery ) ); | |
| 102 | - #> | |
| 81 | + <# var controlUID = '<?php echo esc_html( $control_uid ); ?>'; #> | |
| 82 | + <# var currentID = elementor.panel.currentView.currentPageView.model.attributes.settings.attributes[data.name]; #> | |
| 83 | + <# var maxSelection = (data.maximum_selection_length > 0) ? 'max-select'+data.maximum_selection_length : 'unlimited-select' #> | |
| 84 | + <div class="elementor-control-field rt-select2-main-wrapper {{maxSelection}}"> | |
| 85 | + <# if ( data.label ) { #> | |
| 86 | + <label for="<?php echo esc_attr( $control_uid ); ?>" class="elementor-control-title">{{{data.label }}}</label> | |
| 87 | + <# } #> | |
| 88 | + <div class="elementor-control-input-wrapper elementor-control-unit-5"> | |
| 89 | + <# var multiple = ( data.multiple ) ? 'multiple' : ''; #> | |
| 90 | + <select id="<?php echo esc_attr( $control_uid ); ?>" {{ multiple }} class="rt-select2" data-setting="{{ data.name }}"></select> | |
| 91 | + </div> | |
| 92 | + <# if ( data.description ) { #> | |
| 93 | + <div class="elementor-control-field-description rtsb-description">{{{ data.description }}}</div> | |
| 94 | + <# } #> | |
| 95 | + </div> | |
| 96 | + <# | |
| 97 | + ( function( $ ) { | |
| 98 | + $( document.body ).trigger( 'rt_select2_event',{currentID:data.controlValue,data:data,controlUID:controlUID,multiple:data.multiple} ); | |
| 99 | + }( jQuery ) ); | |
| 100 | + #> | |
| 103 | 101 | <?php |
| 104 | 102 | } |
| 105 | 103 | } |