x-tag/deck — pull request #2 by Jamtis (2014-02-04 15:05:20+00:00)
Title: Dynamic creation fix

The `lifecycle.created` method invokes several methods that failed on dynamical creation.

1. `_getAllCards` failed because the element has no `parentNode` on dynamic creation.
I fixed this by catching the thrown error and returning a empty array.
**Note:** I know that returning a empty array instead of a dom-array is bad practice but a `NodeList` cannot be created manually and it seems semantically correct to return an empty array if there are no `children`.
2. `placeWithIndex` failed because the element has no x-card `children` on dynamic creation.
I fixed it by validating the `targetIndex` parameter with a check against `-1`.