src/js/widgets.js
branchpopcorn-port
changeset 114 eda061f1aa75
parent 98 ed4ac18baf07
child 122 04bd1e2f9674
--- a/src/js/widgets.js	Fri Oct 21 14:05:59 2011 +0200
+++ b/src/js/widgets.js	Fri Oct 21 14:06:29 2011 +0200
@@ -1,9 +1,19 @@
 /* the widget classes and definitions */
 
 IriSP.Widget = function(Popcorn, config, Serializer) {
+
+  if (config === undefined || config === null) {
+    config = {}
+  }
+  
   this._Popcorn = Popcorn;
   this._config = config;  
   this._serializer = Serializer;
+  
+  if (config.hasOwnProperty("divId")) {
+     this._id = config.divId;
+     this.selector = IriSP.jQuery("#" + this._id);
+  }  
 };
 
 IriSP.Widget.prototype.draw = function() {
@@ -13,8 +23,3 @@
 IriSP.Widget.prototype.redraw = function() {
   /* implemented by "sub-classes" */  
 };
-
-IriSP.PlayerWidget = function(Popcorn, config, Serializer) {
-  IriSP.Widget.call(this, Popcorn, config, Serializer);
-  
-};
\ No newline at end of file