driftyco/ionic — pull request #2232 by colllin (2014-09-17 08:36:11+00:00)
Title: ionSlideBox: automatically update when ionSlides are added/removed

**Proposal**
ionSlideBox automatically updates itself when slides are dynamically added/removed.

**Example of using this functionality**
```

...
...
...

```

**Bug Fixes**
Fixes #1578.
Possibly affects #1501 and #1473.
Should fix #1342.
Possibly affects #782.

**Integration**
It's now unnecessary to manually call `slideBox.update()` when slides are added or removed. I'm not sure if there are other times when `update()` needs to be called, otherwise we could possibly deprecate it. How should this change be messaged to developers? Should we `console.log('Warning:...')` when `slideBox.update()` is called?

**Todo**
- [ ] run ionic tests
- [ ] write new tests
- [ ] handle this edge case where `setup()` clones some children -- what will happen if a slide is then added or removed?
```
//special case if two slides
if (browser.transitions && options.continuous && slides.length < 3) {
element.appendChild(slides[0].cloneNode(true));
element.appendChild(element.children[1].cloneNode(true));
slides = element.children;
}
```