PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 3.2.2
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v3.2.2
3.2.2 3.2.3 3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 All 174 releases
master-addons / inc / controls / visual-select.php

visual-select.php in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 3.2.2, at inc/controls/visual-select.php

79 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace MasterAddons\Inc\Controls;
4
5 use Elementor\Base_Data_Control;
6 use MasterAddons\Inc\Classes\Assets_Manager;
7
8 if (!defined('ABSPATH')) {
9 exit;
10 };
11
12 class JLTMA_Visual_Select extends Base_Data_Control
13 {
14
15 public function get_type()
16 {
17 return 'jltma-visual-select';
18 }
19
20 protected function get_default_settings()
21 {
22 return ['label_block' => true];
23 }
24
25 public function get_default_value()
26 {
27 return parent::get_default_value();
28 }
29
30 public function enqueue()
31 {
32 Assets_Manager::enqueue('visual-select');
33 }
34
35 public function content_template()
36 {
37 $control_uid = $this->get_control_uid();
38 ?>
39 <div class="elementor-control-field">
40 <label for="<?php echo esc_attr($control_uid); ?>" class="elementor-control-title">{{{ data.label }}}</label>
41 <div class="elementor-control-input-wrapper">
42 <select class="visual-select-wrapper" id="<?php echo esc_attr($control_uid); ?>" data-setting="{{ data.name }}">
43 <# _.each( data.options, function( option_params, option_value ) { var value=data.controlValue; if ( typeof value=='string' ) { var selected=( option_value===value ) ? 'selected' : '' ; } else if ( null !==value ) { var value=_.values( value ); var selected=( -1 !==value.indexOf( option_value ) ) ? 'selected' : '' ; } if ( option_params.css_class ) { #>
44 <option {{ selected }} data-class="{{ option_params.css_class }}" value="{{ option_value }}">{{{ option_params.label }}}</option>
45 <# } else if( option_params.video_src ) { #>
46 <option {{ selected }} data-video-src="{{ option_params.video_src }}" value="{{ option_value }}">{{{ option_params.label }}}</option>
47 <# } else if( option_params.image ) { #>
48 <option {{ selected }} data-symbol="{{ option_params.image }}" value="{{ option_value }}">{{{ option_params.label }}}</option>
49 <# } else { #>
50 <option {{ selected }} value="{{ option_value }}">{{{ option_params.label }}}</option>
51 <# } }); #>
52 </select>
53 <# if( data.style_items ){ #>
54 <style>
55 #elementor-control-default- {
56 {
57 {
58 data._cid
59 }
60 }
61 }
62
63 +.jltma-visual-select .jltma-select-item {
64 {
65 {
66 {
67 data.style_items
68 }
69 }
70 }
71 }
72 </style>
73 <# } #>
74 </div>
75 </div>
76 <?php
77 }
78 }
79