Skip to content

Commit f52b146

Browse files
committed
feat(ticks): Accept numbers for showTicks/showTicksValues
Thanks to this feature, you can display ticks at intermediate positions without setting a fixed step
1 parent 80ae07c commit f52b146

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

dist/rzslider.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -751,12 +751,13 @@
751751
*/
752752
updateTicksScale: function() {
753753
if (!this.options.showTicks) return;
754-
755-
var positions = '',
756-
ticksCount = Math.round((this.maxValue - this.minValue) / this.step) + 1;
754+
var step = this.step;
755+
if(angular.isNumber(this.options.showTicks))
756+
step = this.options.showTicks;
757+
var ticksCount = Math.round((this.maxValue - this.minValue) / step) + 1;
757758
this.scope.ticks = [];
758759
for (var i = 0; i < ticksCount; i++) {
759-
var value = this.roundStep(this.minValue + i * this.step);
760+
var value = this.roundStep(this.minValue + i * step);
760761
var tick = {
761762
selected: this.isTickSelected(value)
762763
};

0 commit comments

Comments
 (0)