src/js/layout.js
branchpopcorn-port
changeset 159 de92bfdcbe4c
parent 138 37b70a8c61a2
child 217 ec3e6d34462c
equal deleted inserted replaced
158:1813e6e4f0d6 159:de92bfdcbe4c
     9     this._Popcorn = null;
     9     this._Popcorn = null;
    10     this._widgets = [];
    10     this._widgets = [];
    11     
    11     
    12     this._div = "LdtPlayer";
    12     this._div = "LdtPlayer";
    13     this._width = 640;
    13     this._width = 640;
    14     this._height = 480;
       
    15     
    14     
    16     if (options === undefined) {
    15     if (options === undefined) {
    17       options = {};
    16       options = {};
    18     };
    17     };
    19     
    18     
    31     
    30     
    32     /* this is a shortcut */
    31     /* this is a shortcut */
    33     this.selector = IriSP.jQuery("#" + this._div);
    32     this.selector = IriSP.jQuery("#" + this._div);
    34     
    33     
    35     this.selector.css("width", this._width);
    34     this.selector.css("width", this._width);
    36     this.selector.css("height", this._height);
    35     
       
    36     if (this._height !== undefined)
       
    37       this.selector.css("height", this._height);
    37 };
    38 };
    38 
    39 
    39 /* we need this special setter because of a chicken and egg problem :
    40 /* we need this special setter because of a chicken and egg problem :
    40    we want the manager to use popcorn but the popcorn div will be managed
    41    we want the manager to use popcorn but the popcorn div will be managed
    41    by the manager. So we need a way to set the instance the manager uses
    42    by the manager. So we need a way to set the instance the manager uses
    47 }
    48 }
    48 
    49 
    49 IriSP.LayoutManager.prototype.createDiv = function() {
    50 IriSP.LayoutManager.prototype.createDiv = function() {
    50     var newDiv = Popcorn.guid(this._div + "_widget_");
    51     var newDiv = Popcorn.guid(this._div + "_widget_");
    51     this._widgets.push(newDiv);    
    52     this._widgets.push(newDiv);    
    52     this.selector.append("<div id='" + newDiv + "'></div");
    53     this.selector.append("<div id='" + newDiv + "' style='width: 100%'></div");
    53     
    54     
    54     return newDiv;
    55     return newDiv;
    55 };
    56 };