From 97ede3643ee1797cf5a608ca97392e8cbce5f6d3 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 14 Mar 2015 11:24:47 +0530 Subject: [PATCH] Ox.Range: update size if max/min/step changes --- source/UI/js/Form/Range.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/UI/js/Form/Range.js b/source/UI/js/Form/Range.js index 168e0419..e1f3e9ef 100644 --- a/source/UI/js/Form/Range.js +++ b/source/UI/js/Form/Range.js @@ -53,6 +53,9 @@ Ox.Range = function(options, self) { }) .options(options || {}) .update({ + max: setSizes, + min: setSizes, + step: setSizes, size: setSizes, trackColors: setTrackColors, value: setThumb @@ -76,9 +79,6 @@ Ox.Range = function(options, self) { self.trackColors = self.options.trackColors.length; self.trackImages = self.options.trackImages.length; - self.values = ( - self.options.max - self.options.min + self.options.step - ) / self.options.step; setSizes(); @@ -219,6 +219,9 @@ Ox.Range = function(options, self) { } function setSizes() { + self.values = ( + self.options.max - self.options.min + self.options.step + ) / self.options.step; self.trackSize = self.options.size - self.options.arrows * 32; self.thumbSize = Math.max(self.trackSize / self.values, self.options.thumbSize); self.trackImageWidths = self.trackImages == 1