Skip to content

Commit c61fbd4

Browse files
author
Valentin Hervieu
committed
Support getSelectionBarColor for ticks.
1 parent e5f3ab8 commit c61fbd4

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

demo/demo.js

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ app.controller('MainCtrl', function($scope, $rootScope, $timeout, $modal) {
2525
}
2626
};
2727

28-
2928
//Slider with selection bar
3029
$scope.color_slider_bar = {
3130
value: 12,

dist/rzslider.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,9 @@
667667
var tick = {
668668
selected: this.isTickSelected(value)
669669
};
670+
if (tick.selected && this.options.getSelectionBarColor) {
671+
tick.style = {backgroundColor: this.options.getSelectionBarColor()};
672+
}
670673
if (this.options.showTicksValues) {
671674
tick.value = this.getDisplayValue(value);
672675
if (this.options.ticksValuesTooltip) {
@@ -676,6 +679,7 @@
676679
}
677680
this.scope.ticks.push(tick);
678681
}
682+
console.info(this.scope.ticks)
679683
},
680684

681685
isTickSelected: function(value) {
@@ -865,7 +869,7 @@
865869
updateSelectionBar: function() {
866870
this.setDimension(this.selBar, Math.abs(this.maxH.rzsp - this.minH.rzsp) + this.handleHalfDim);
867871
this.setPosition(this.selBar, this.range ? this.minH.rzsp + this.handleHalfDim : 0);
868-
if(this.options.getSelectionBarColor) {
872+
if (this.options.getSelectionBarColor) {
869873
var color = this.options.getSelectionBarColor();
870874
this.selBarChild.css({backgroundColor: color});
871875
}
@@ -1434,7 +1438,7 @@
14341438
'use strict';
14351439

14361440
$templateCache.put('rzSliderTpl.html',
1437-
"<span class=rz-bar-wrapper><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class=\"rz-bar rz-selection\"></span></span> <span class=rz-pointer></span> <span class=rz-pointer></span> <span class=\"rz-bubble rz-limit\"></span> <span class=\"rz-bubble rz-limit\"></span> <span class=rz-bubble></span> <span class=rz-bubble></span> <span class=rz-bubble></span><ul ng-show=showTicks class=rz-ticks><li ng-repeat=\"t in ticks\" class=tick ng-class=\"{selected: t.selected}\"><span ng-if=\"t.value != null && t.tooltip == null\" class=tick-value>{{ t.value }}</span> <span ng-if=\"t.value != null && t.tooltip != null\" class=tick-value uib-tooltip=\"{{ t.tooltip }}\" tooltip-placement={{t.tooltipPlacement}}>{{ t.value }}</span></li></ul>"
1441+
"<span class=rz-bar-wrapper><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class=\"rz-bar rz-selection\"></span></span> <span class=rz-pointer></span> <span class=rz-pointer></span> <span class=\"rz-bubble rz-limit\"></span> <span class=\"rz-bubble rz-limit\"></span> <span class=rz-bubble></span> <span class=rz-bubble></span> <span class=rz-bubble></span><ul ng-show=showTicks class=rz-ticks><li ng-repeat=\"t in ticks\" class=tick ng-class=\"{selected: t.selected}\" ng-style=t.style><span ng-if=\"t.value != null && t.tooltip == null\" class=tick-value>{{ t.value }}</span> <span ng-if=\"t.value != null && t.tooltip != null\" class=tick-value uib-tooltip=\"{{ t.tooltip }}\" tooltip-placement={{t.tooltipPlacement}}>{{ t.value }}</span></li></ul>"
14381442
);
14391443

14401444
}]);

0 commit comments

Comments
 (0)