sproutcore/sproutcore — pull request #853 by publickeating (2012-10-16 17:33:51+00:00)
Title: Adds design modes support to SC.Pane, allowing the design of an applicat...

...ion to very efficiently and easily change depending on the width of the display.

While a design may be flexible for a wide range of display widths, at a certain point it no longer makes sense to keep stretching or compressing views and instead it is better to completely alter the design. A prime example is that a design that can flex between a medium sized display like a tablet and a large sized display like a desktop, will not likely work for a small display like a smartphone. In order to very easily alter the design, SC.Pane provides the designModes property which includes the width thresholds that you want to trigger a change to the overall design of the application. Each time a threshold width is crossed, the child views will be updated with the new design mode. At this point, any properties dependent on 'designMode' will recompute allowing you to adjust settings such as isVisible.

As well, SC.View has a new property 'designLayouts' that is simply the layouts for the 'designModes' you define. For example, if the design mode becomes 'small' any child view that has a 'small' designLayout will have its layout automatically set.

This completes work spec #843. See the work spec for more details.

* I'll try to add a demo of this in use to Showcase before too long