1 <?php
2 3 4 5 6 7 8 9 10
11 namespace uix\ui\control;
12
13 14 15 16 17 18
19 class slider extends \uix\ui\control\text{
20
21 22 23 24 25 26 27
28 public $type = 'slider';
29
30 31 32 33 34 35
36 public function set_assets() {
37
38
39 $this->assets['style']['slider-control'] = $this->url . 'assets/controls/slider/css/ion.rangeSlider' . UIX_ASSET_DEBUG . '.css';
40 $this->assets['style']['slider-control-theme'] = $this->url . 'assets/controls/slider/css/ion.rangeSlider.skinHTML5' . UIX_ASSET_DEBUG . '.css';
41
42
43
44 $this->assets['script']['slider-control'] = $this->url . 'assets/controls/slider/js/ion.rangeSlider' . UIX_ASSET_DEBUG . '.js';
45 $this->assets['script']['slider-control-init'] = array(
46 "src" => $this->url . 'assets/controls/slider/js/ion.rangeSlider.init' . UIX_ASSET_DEBUG . '.js',
47 "in_footer" => true
48 );
49
50 parent::set_assets();
51 }
52 53 54 55 56 57
58 protected function enqueue_active_assets(){
59
60 if( !empty( $this->struct['base_color'] ) ){
61 echo '<style type="text/css">';
62
63 echo '.' . $this->id() . ' .irs-grid-pol {background: ' . $this->struct['base_color'] . ';}';
64 echo '.' . $this->id() . ' .irs-bar {border-top: 1px solid ' . $this->struct['base_color'] . ';border-bottom: 1px solid ' . $this->struct['base_color'] . ';background: ' . $this->struct['base_color'] . ';}';
65 echo '.' . $this->id() . ' .irs-bar-edge {border: 1px solid ' . $this->struct['base_color'] . ';background: ' . $this->struct['base_color'] . ';}';
66 echo '.' . $this->id() . ' .irs-from, .' . $this->id() . ' .irs-to, .' . $this->id() . ' .irs-single {background: ' . $this->struct['base_color'] . ';}';
67
68 echo '</style>';
69 }
70
71 }
72
73 74 75 76 77 78 79
80 public function classes() {
81
82 $classes = array(
83 'uix-slider'
84 );
85
86 return $classes;
87 }
88
89
90 91 92 93 94 95
96 public function set_attributes() {
97
98 $this->attributes['data-type'] = 'single';
99 $this->attributes['data-input-values-separator'] = ';';
100
101 parent::set_attributes();
102
103
104 }
105
106
107 }