derickbailey/backbone.modelbinding — Issue #30: Use jQuery's native show/hide data-bind special cases
Author: dswitzer
Created: 2011-10-11 17:21:24+00:00
State: open

I'd like to see the native show/hide methods used for the data-bind special cases. The reason is these methods correctly handle inline elements. The current code is setting the element's css property--which causes issues if your element is an inline element (such as a span.)

For example, change:

```js
case "displayed":
element.css("display", val ? 'block' : 'none' );
break;
case "hidden":
element.css("display", val ? 'none' : 'block' );
```

To:

```js
case "displayed":
element[val ? "show" : "hide"]();
break;
case "hidden":
element[val ? "hide" : "show"]();
```

As an extra bonus, it would be extra useful if you could configure the effect (such as fadeIn for show, fadeOut for hide.)