+1
Auto is going to be a very hard default to test unless it's very well specified. Let's change the default back to horizontal as that's the most common case (as all our defaults should be) and remove auto for now. If someone specifies vertical, we now have a default height of 100px, which should make it easier.
Paul,Can you explain a situation where this feature would be used? A reason someone would choose auto orientation?Have you seen it used on any sites yet?I'm having trouble thinking of a case where you'd want the script to choose this option for you.Even if the parent element is taller than it is wide, why does that mean a vertical slider is more appropriate?Aside from being sorta technically neat, it seems like bloat to me. Seeing it in the docs confused me.
The orientation detection is incredibly simple. It just checks if the height is greater than the slider width, and if that's true, the orientation is 'vertical', if not, it's horizontal. That sounds like pretty common to me. Maybe all we need is to change the check a bit, to default to 'horizontal' in equal (0 == 0) situations.
-1 for removing auto as optionOn Mon, Feb 16, 2009 at 10:36 PM, Scott González <scott.g...@gmail.com> wrote:
+1 for removing auto as a valid option and setting the default to horizontalOn Mon, Feb 16, 2009 at 3:51 PM, Richard D. Worth <rdw...@gmail.com> wrote:
+1
Auto is going to be a very hard default to test unless it's very well specified. Let's change the default back to horizontal as that's the most common case (as all our defaults should be) and remove auto for now. If someone specifies vertical, we now have a default height of 100px, which should make it easier.
--
Also, what happens when the size of the container changes? Is it auto on init or is it auto always?
And if it's set to auto, checking whether the slider is vertical or horizontal is not as simple as checking the value of the orientation option, but you'd have to check the element for a ui-slider-horizontal or ui-slider-vertical class.
On Tue, Feb 17, 2009 at 1:34 PM, Richard D. Worth <rdw...@gmail.com> wrote:Also, what happens when the size of the container changes? Is it auto on init or is it auto always?
And if it's set to auto, checking whether the slider is vertical or horizontal is not as simple as checking the value of the orientation option, but you'd have to check the element for a ui-slider-horizontal or ui-slider-vertical class.
Right now, it's already rechecking the orientation on _setData, but it's not changing anything, so we would need to toggle those classes I guess, and a couple different things.
- Richard
Sortable is different. If you float a sortable list, thats a distict layout decision resulting in a floated sortable. It's great the plugin detects the float, but I wouldn't have expected I'd need an option for that anyway. why is float a public option? This is a valid case for auto detection but I think most users would assume you could sort a floated list anyway. We handle the complexity of making that sort work.Back to slider, just because I drop a slider into a tall div, it doesn't mean I want a vertical slider. Vertical sliders are less common and when they're needed, it's easy to specify you want one.Did you see my $('<div></div>') example?
From a designer's perspective, I can't see a situation where I'd put a
slider on a page and not have a really clear idea of the orientation
and size I want it to be. It makes no sense to use 'auto' which is to
say "put a slider on the page, I don't care how it looks". Having the
script calculate things for collision detection for menus or flat for
draggable is nice but this is a situation where I *want* to make a
decision. It's like saying "put in a tab strip, I don't care it the
tabs are on the top or left". It would never happen in the real world.
- Richard
Btw- we went to great lengths to make a slider stretch to fit it's container for this very reason. It's entirely percentage based to fit into whater you put it in and even scales when the parent resizes without need for scripting.Still though, a use case would be helpful to hear. If you're okay with this being a nondefault option, what purpose does it serve? You aren't removing a user decision because auto would need to be specified explicitly
I don't believe we should detect and react to a change in a slider's relative width and height, so it would follow that we shouldn't do the same at init.
This breaks our API though. We were originally commiting to the idea that you can always change options at a later point after init. Do you really think we should make an exception here?
- Richard
Of course you care about if the tabs are top or left. But isn't it cool that
the script /knows/ what you want in advance, so you don't need to use
the option at all?