updated layout and init to give more meaningful names to the widgets divs. popcorn-port
authorhamidouk
Wed, 23 Nov 2011 17:15:29 +0100
branchpopcorn-port
changeset 315 4466bf448426
parent 314 da3eafabe9ce
child 316 3b11a798f5e4
updated layout and init to give more meaningful names to the widgets divs.
src/js/init.js
src/js/layout.js
--- a/src/js/init.js	Wed Nov 23 15:49:51 2011 +0100
+++ b/src/js/init.js	Wed Nov 23 17:15:29 2011 +0100
@@ -67,7 +67,7 @@
 
 IriSP.instantiateWidget = function(popcornInstance, serialFactory, layoutManager, widgetConfig) {
     /* create div returns us a container for the widget and a spacer */
-    var ret = layoutManager.createDiv();        
+    var ret = layoutManager.createDiv(widgetConfig.type);        
     var container = ret[0];
     var spacer = ret[1];
 
--- a/src/js/layout.js	Wed Nov 23 15:49:51 2011 +0100
+++ b/src/js/layout.js	Wed Nov 23 17:15:29 2011 +0100
@@ -46,9 +46,13 @@
     this._Popcorn = popcorn;
 }
 
-IriSP.LayoutManager.prototype.createDiv = function() {
-    var newDiv = Popcorn.guid(this._div + "_widget_");
-    var spacerDiv = Popcorn.guid("_spacer_");
+/* stem is a string to append to the id of the widget */
+IriSP.LayoutManager.prototype.createDiv = function(stem) {
+    if (typeof(stem) === "undefined")
+       stem = "";
+
+    var newDiv = Popcorn.guid(this._div + "_widget_" + stem + "_");
+    var spacerDiv = Popcorn.guid("LdtPlayer_spacer_");
     this._widgets.push(newDiv);
 
     var divTempl = "<div id='{{id}}' style='width: 100%; position: relative;'></div";