Skip to content

Commit 38ed61a

Browse files
author
Valentin Hervieu
committed
Add the possibility to directly click on the slider bar to set the value. It is also possible to click and drag directly from the bar.
1 parent f253533 commit 38ed61a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rzslider.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,9 +848,17 @@ function throttle(func, wait, options) {
848848
{
849849
this.minH.on('mousedown', angular.bind(this, this.onStart, this.minH, 'rzSliderModel'));
850850
if(this.range) { this.maxH.on('mousedown', angular.bind(this, this.onStart, this.maxH, 'rzSliderHigh')); }
851+
this.fullBar.on('mousedown', angular.bind(this, this.onStart, this.fullBar, 'rzSliderModel'));
852+
this.fullBar.on('mousedown', angular.bind(this, this.onMove, this.fullBar));
853+
this.selBar.on('mousedown', angular.bind(this, this.onStart, this.selBar, 'rzSliderModel'));
854+
this.selBar.on('mousedown', angular.bind(this, this.onMove, this.selBar));
851855

852856
this.minH.on('touchstart', angular.bind(this, this.onStart, this.minH, 'rzSliderModel'));
853857
if(this.range) { this.maxH.on('touchstart', angular.bind(this, this.onStart, this.maxH, 'rzSliderHigh')); }
858+
this.fullBar.on('touchstart', angular.bind(this, this.onStart, this.fullBar, 'rzSliderModel'));
859+
this.fullBar.on('touchstart', angular.bind(this, this.onMove, this.fullBar));
860+
this.selBar.on('touchstart', angular.bind(this, this.onStart, this.selBar, 'rzSliderModel'));
861+
this.selBar.on('touchstart', angular.bind(this, this.onMove, this.selBar));
854862
},
855863

856864
/**

0 commit comments

Comments
 (0)