zepto-range icon indicating copy to clipboard operation
zepto-range copied to clipboard

Tweaks and improvements

Open stormtek opened this issue 11 years ago • 68 comments

Added support for an array of values as well as a list of values to be sent to range() Added support for a width parameter to be set on the input field Improved handling of layout of slider options Moved styling for slider to it's own stylesheet to make it easier to use in other projects Improved readme documentation on how to use the slider

stormtek avatar Jun 18 '13 23:06 stormtek

Your examples are broken http://stormtek.github.io/zepto-range/

jcemer avatar Jun 19 '13 05:06 jcemer

Broken in what way?

stormtek avatar Jun 19 '13 05:06 stormtek

image

jcemer avatar Jun 19 '13 05:06 jcemer

it looks fine for me ...

stormtek avatar Jun 19 '13 05:06 stormtek

zepto

stormtek avatar Jun 19 '13 05:06 stormtek

Try to open on chrome, firefox... I'm using Chrome Version 27.0.1453.110 on Mac.

jcemer avatar Jun 19 '13 05:06 jcemer

im using ff on windows and it looks fine

stormtek avatar Jun 19 '13 05:06 stormtek

It looks fine in Firefox on Ubuntu 12.10, Firefox on OSX, but you are right ... it breaks on chrome on both OSX and windows ...

stormtek avatar Jun 19 '13 05:06 stormtek

So a styling issue with chrome? Does your original demo work on Chrome?

stormtek avatar Jun 19 '13 05:06 stormtek

That is weird, I will look into it further. Cos that is a serious issue ...

stormtek avatar Jun 19 '13 05:06 stormtek

Thanks for the heads up by the way :)

stormtek avatar Jun 19 '13 05:06 stormtek

also crome on android is brøken. it used to work. Den 19/06/2013 07.33 skrev "stormtek" [email protected]:

So a styling issue with chrome? Does your original demo work on Chrome?

— Reply to this email directly or view it on GitHubhttps://github.com/jcemer/zepto-range/pull/2#issuecomment-19663950 .

Ruffio avatar Jun 19 '13 05:06 Ruffio

So it it a problem with chrome on almost all platforms ... it does work on firefox on all those platforms though

stormtek avatar Jun 19 '13 05:06 stormtek

Looking at the generated html, the wrapper div being created has width being set to 0px when we are grabbing the width automatically rather than taking it from the input field value. So we are not getting the general width from the browser for some reason. That makes it a bug in the javascript. Hopefully that should not be too hard to fix.

stormtek avatar Jun 19 '13 05:06 stormtek

@stormtek you are trying to get this.input.attr('width') where it should be this.input.width(). That's one of the problems.

ricardobeat avatar Jun 19 '13 05:06 ricardobeat

That is needed to allow the user to define the width of the slider in the input field. The problem is that if that is not specified then it is returning 0 in Chrome. I think I can fix it fairly easily by dropping to this.input.width() if we get 0 from the existing call.

stormtek avatar Jun 19 '13 05:06 stormtek

How do I get that change back to the link we are looking at?

stormtek avatar Jun 19 '13 05:06 stormtek

That does fix the problem when I run it locally in Chrome on my macbook though

stormtek avatar Jun 19 '13 05:06 stormtek

Ok, may just need to wait a few minutes for testing live. But I do believe that is fixed now.

stormtek avatar Jun 19 '13 06:06 stormtek

Yea, that is up and working in Chrome on both osx and windows.

stormtek avatar Jun 19 '13 06:06 stormtek

the test seams to work now in chrome om android. it is not supposed to fill 100% right? Den 19/06/2013 08.01 skrev "stormtek" [email protected]:

Yea, that is up and working in Chrome on both osx and windows.

— Reply to this email directly or view it on GitHubhttps://github.com/jcemer/zepto-range/pull/2#issuecomment-19664614 .

Ruffio avatar Jun 19 '13 08:06 Ruffio

If there is no wrapper div with a width specified and no width set on the input then it should fill 100%. I have updated the demo to show that with one of the sliders.

stormtek avatar Jun 19 '13 09:06 stormtek

beautiful :) you should check description for max parameter. and what does inside do? missing a description? Den 19/06/2013 11.26 skrev "stormtek" [email protected]:

If there is no wrapper div with a width specified and no width set on the input then it should fill 100%. I have updated the demo to show that with one of the sliders.

— Reply to this email directly or view it on GitHubhttps://github.com/jcemer/zepto-range/pull/2#issuecomment-19672053 .

Ruffio avatar Jun 19 '13 10:06 Ruffio

what do you mean by check description for max parameter?

stormtek avatar Jun 20 '13 01:06 stormtek

The description for max parameter at the index page is incorrect. The value should be lager than min valmue, not larger by itself. Den 20/06/2013 03.13 skrev "stormtek" [email protected]:

what do you mean by check description for max parameter?

— Reply to this email directly or view it on GitHubhttps://github.com/jcemer/zepto-range/pull/2#issuecomment-19725470 .

Ruffio avatar Jun 20 '13 04:06 Ruffio

I see it now ... stupid eyes filling in what I expect to be there and glossing over what is there ...

stormtek avatar Jun 20 '13 04:06 stormtek

How do you set initial value? Is it possible to get 'end value' while the moving is occuring?

Perhaps describe this in readme.md?

Ruffio avatar Jun 20 '13 19:06 Ruffio

I do not believe it is possible to get the 'end value' while the slider is in motion, though I could be wrong. To be honest, I cannot think of a sensible time where you would want to anyway.

stormtek avatar Jun 21 '13 04:06 stormtek

I have now adjusted the slider to show the min and max values that are specified in the input field if no options are passed to range(). This makes it more obvious what is going on, and also makes the slider usable even if semantic information is not being presented through custom labels. It also makes it more obvious that the value is being set correctly when the slider is created.

stormtek avatar Jun 21 '13 05:06 stormtek

Would it be possible to implement an option to disable legend/bars?

If the range is large and the witdh is small one will get 'one' (what appears to be) one lang white bar below the slider.

It would be nice, if one could only disable the bars, but still keeping min and max legend.

Ruffio avatar Jun 21 '13 10:06 Ruffio