From 60eed738e12ed073ed3dd7fc4308616aa5dfd41e Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Mon, 13 Oct 2014 10:39:16 +0200 Subject: [PATCH] fgfs.js: allow lazy loading of animated elements --- webgui/lib/fgfs.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webgui/lib/fgfs.js b/webgui/lib/fgfs.js index dcfaf04de..ebff386b8 100644 --- a/webgui/lib/fgfs.js +++ b/webgui/lib/fgfs.js @@ -307,11 +307,15 @@ FGFS.TranslateTransform = function(arg) { FGFS.Animation = function(arg) { this.element = arg.element; this.type = arg.type; + this._element = null; this.__proto__.update = function(svg) { - var t = typeof (this._element); - if (typeof (this._element) == 'undefined') { + if (null == this._element) { this._element = $(svg).find(this.element); + if( 0 == this._element.length ) { + this._element = null; + return; + } } this._element.fgAnimateSVG(this.makeAnimation());