src/js/widgets.js
changeset 988 eefd336335f9
parent 986 f9d51dd4a3fe
child 992 566b590aaf8f
--- a/src/js/widgets.js	Thu Jan 17 17:25:46 2013 +0100
+++ b/src/js/widgets.js	Fri Jan 25 18:16:29 2013 +0100
@@ -35,8 +35,10 @@
        _this[_key] = _value;
     });
     
+    this.$ = IriSP.jQuery('#' + this.container);
+    
     if (typeof this.width === "undefined") {
-        this.width = player.config.width;
+        this.width = this.$.width();
     }
     
     /* Setting this.player at the end in case it's been overriden
@@ -45,7 +47,6 @@
     this.player = player;
     
     /* Adding classes and html attributes */
-    this.$ = IriSP.jQuery('#' + this.container);
     this.$.addClass("Ldt-TraceMe Ldt-Widget").attr("widget-type", _type);
     
     this.l10n = (