fgfs.js: allow lazy loading of animated elements
This commit is contained in:
parent
67867d8a32
commit
60eed738e1
1 changed files with 6 additions and 2 deletions
|
@ -307,11 +307,15 @@ FGFS.TranslateTransform = function(arg) {
|
||||||
FGFS.Animation = function(arg) {
|
FGFS.Animation = function(arg) {
|
||||||
this.element = arg.element;
|
this.element = arg.element;
|
||||||
this.type = arg.type;
|
this.type = arg.type;
|
||||||
|
this._element = null;
|
||||||
|
|
||||||
this.__proto__.update = function(svg) {
|
this.__proto__.update = function(svg) {
|
||||||
var t = typeof (this._element);
|
if (null == this._element) {
|
||||||
if (typeof (this._element) == 'undefined') {
|
|
||||||
this._element = $(svg).find(this.element);
|
this._element = $(svg).find(this.element);
|
||||||
|
if( 0 == this._element.length ) {
|
||||||
|
this._element = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this._element.fgAnimateSVG(this.makeAnimation());
|
this._element.fgAnimateSVG(this.makeAnimation());
|
||||||
|
|
Loading…
Add table
Reference in a new issue