Leaflet/Leaflet — pull request #1825 by rutkovsky (2013-07-03 23:16:41+00:00)
Title: Stop transition if element is outside fo the DOM

I have a backbone application, where map is rendered once and then stored globally. And sometimes when users open another page before animation is complete, it gives me a bunch of errors.

```
Uncaught TypeError: Cannot read property '1' of null leaflet.js:8210
L.PosAnimation.L.Class.extend._getPos leaflet.js:8210
L.PosAnimation.L.Class.extend._onStep leaflet.js:8193
(anonymous function)
```
on that line.

```javascript
_getPos: function () {
var left, top, matches,
el = this._el,
style = window.getComputedStyle(el);

if (L.Browser.any3d) {
matches = style[L.DomUtil.TRANSFORM].match(this._transformRe);
left = parseFloat(matches[1]);
-------------- Uncaught TypeError: Cannot read property '1' of null
top = parseFloat(matches[2]);
} else {
left = parseFloat(style.left);
top = parseFloat(style.top);
}

return new L.Point(left, top, true);
},
```