rstudio/shiny — pull request #534 by r2evans (2014-07-08 05:46:56+00:00)
Title: replace `condition` in `conditionalPanel()` with `disable` and `hide`

I wanted to be able to keep an element within view (both for spacing and for the visual effect of it being immutable), so I added two optional arguments to `conditionalPanel()`: `disable` and `hide`.

`hide` is merely a reversal logically from `condition`. In fact, if you accept that having disable/hide as options is relevant, I suggest that deprecating `condition` might be appropriate.

`disable` was a little more challenging and admittedly not as "global" in its capabilities. Namely, it currently only affects text and input fields. For text, it just adds `.shiny-text-disabled` (a new class in shiny.css that lightens the font color). For input elements, it also disables the elements two ways (using `.ui-state-disabled` from jQuery ui and the `disabled` HTML5 property).

There might be a way to broaden this to other types of elements (e.g., images and plots), but I'm not certain how to do that with plots that shiny touches. My vision has an output plot graying out and not updating with input changes, but this would probably require a bit more JS <--> Shiny interaction than I'm able to tackle at the moment.

Tested using the kmeans-example on win7, R-3.1.0, chrome 35.0.1916.153 m.