Skip to content

Commit 831212b

Browse files
author
Valentin Hervieu
committed
Add an id option that is passed to the translate function as second arg
As discussed in #161
1 parent 1843254 commit 831212b

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

dist/rzslider.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@
3737
ceil: null, //defaults to rz-slider-model
3838
step: 1,
3939
precision: 0,
40+
id: null,
4041
translate: null,
4142
stepsArray: null,
42-
draggableRange: false,
43+
draggableRange: false,
4344
showSelectionBar: false,
4445
hideLimitLabels: false,
4546
readOnly: false,
@@ -553,7 +554,7 @@
553554
translateFn: function(value, label, useCustomTr) {
554555
useCustomTr = useCustomTr === undefined ? true : useCustomTr;
555556

556-
var valStr = String((useCustomTr ? this.customTrFn(value) : value)),
557+
var valStr = String((useCustomTr ? this.customTrFn(value, this.options.id) : value)),
557558
getWidth = false;
558559

559560
if (label.rzsv === undefined || label.rzsv.length !== valStr.length || (label.rzsv.length > 0 && label.rzsw === 0)) {
@@ -872,7 +873,7 @@
872873
* @returns {*}
873874
*/
874875
getDisplayValue: function(value) {
875-
return this.customTrFn(value);
876+
return this.customTrFn(value, this.options.id);
876877
},
877878

878879
/**

0 commit comments

Comments
 (0)