removed default height from layout.js. popcorn-port
authorhamidouk
Fri, 28 Oct 2011 11:07:41 +0200
branchpopcorn-port
changeset 159 de92bfdcbe4c
parent 158 1813e6e4f0d6
child 160 d3f336807ec3
removed default height from layout.js.
src/js/layout.js
unittests/tests/layout.js
--- a/src/js/layout.js	Thu Oct 27 13:36:49 2011 +0200
+++ b/src/js/layout.js	Fri Oct 28 11:07:41 2011 +0200
@@ -11,7 +11,6 @@
     
     this._div = "LdtPlayer";
     this._width = 640;
-    this._height = 480;
     
     if (options === undefined) {
       options = {};
@@ -33,7 +32,9 @@
     this.selector = IriSP.jQuery("#" + this._div);
     
     this.selector.css("width", this._width);
-    this.selector.css("height", this._height);
+    
+    if (this._height !== undefined)
+      this.selector.css("height", this._height);
 };
 
 /* we need this special setter because of a chicken and egg problem :
@@ -49,7 +50,7 @@
 IriSP.LayoutManager.prototype.createDiv = function() {
     var newDiv = Popcorn.guid(this._div + "_widget_");
     this._widgets.push(newDiv);    
-    this.selector.append("<div id='" + newDiv + "'></div");
+    this.selector.append("<div id='" + newDiv + "' style='width: 100%'></div");
     
     return newDiv;
 };
--- a/unittests/tests/layout.js	Thu Oct 27 13:36:49 2011 +0200
+++ b/unittests/tests/layout.js	Fri Oct 28 11:07:41 2011 +0200
@@ -10,10 +10,9 @@
       var lay = new IriSP.LayoutManager();
       equal(lay._div, "LdtPlayer", "the default div is set correctly");
       equal(lay._width, 640, "the default width is set correctly");
-      equal(lay._height, 480, "the default height is set correctly");
+      equal(lay._height, undefined, "the default height is set correctly");
       
-      equal(IriSP.jQuery("#" + lay._div).css("width"), lay._width + "px", "div width is set correctly");
-      equal(IriSP.jQuery("#" + lay._div).css("height"), lay._height + "px", "div height is set correctly");
+      equal(IriSP.jQuery("#" + lay._div).css("width"), lay._width + "px", "div width is set correctly");      
   });
   
   test("test custom init of layout manager", function() {