66 <input type =" range" :style =" cssColor" :class =" [(playSlider)? 'iv-range-play' : 'iv-range']" v-model.number =" value" :min =" min" :max =" max" :step =" step" @mousedown =" startDrag" @mousemove =" emitSlider" @mouseup =" stopDrag" @change =" emitSliderAgain" >
77 <iv-line-ticks v-if =" lineTick" :sliderTicksList =" tick_list" :thumb_width =" thumb_width" :min =" min" :max =" max" :key =" tick_line_key" />
88 <iv-num-ticks v-if =" numTick" :sliderTicksList =" tick_list" :thumb_width =" thumb_width" :min =" min" :max =" max" :key =" tick_num_key" />
9- <iv-button v-if =" resetButton" style =" height :100% " @click =" reset" >Reset</iv-button >
10- <iv-button v-if =" playButton" style =" height :100% " @click =" togglePlay" >
9+ <iv-button id =" resetButton" v-if =" resetButton" style =" height :100% ;" @click =" reset" >Reset</iv-button >
10+ <div style =" text-align :center ;" >
11+ <iv-button id =" playButton" v-if =" playButton" @click =" togglePlay" >
1112 <span v-if =" isPlaying" >Pause</span >
1213 <span v-if =" !isPlaying" >
1314 <span v-if =" value>=max" >Reset</span >
1415 <span v-else >Play</span >
1516 </span >
1617 </iv-button >
18+ </div >
1719 </div >
1820 <iv-input-button v-if =" sliderButtons" :sliderValue =" value" :playSlider =" playSlider" :buttonInput =" buttonInput" :min =" min" :max =" max" :button_step_init =" button_step_init" @inputButtonClicked =" update_val_button" />
1921 </div >
@@ -108,6 +110,12 @@ export default {
108110 time_step: {
109111 type: Number ,
110112 default: 100 ,
113+ },
114+ playButtonPosition: {
115+ type: String ,
116+ required: false ,
117+ default: " left" ,
118+
111119 }
112120 },
113121 data (){
@@ -127,19 +135,18 @@ export default {
127135 playButtonState: " Play" ,
128136 isPlaying: false ,
129137 timer: null ,
138+ // playButtonPosition: this.playButtonPosition
130139 }
131140 },
132141 methods: {
133142 update_val_button (e ){
134- // console.log(e);
135143 this .value = e;
136144 },
137145 calc_ticks (){
138146 let tick_list = [];
139147 for (let i= this .min ; i <= this .max ; i+= this .tick_step ){
140148 tick_list .push ({id: this .id .toString () + " _" + i .toString (), value: i .toFixed (this .tick_decimals )});
141149 }
142- console .log (tick_list)
143150 return tick_list
144151 },
145152 startDrag (){
@@ -187,6 +194,11 @@ export default {
187194 },
188195
189196 mounted () {
197+ let play = document .getElementById (" playButton" );
198+ if ([" left" , " right" ].includes (this .playButtonPosition )){
199+ play .style [" float" ] = this .playButtonPosition ;
200+ }
201+
190202 this .id = this ._uid ;
191203 // this.min_step_size();
192204 this .tick_list = this .calc_ticks ();
0 commit comments