src/js/layout.js
branchpopcorn-port
changeset 287 5c7495102bd7
parent 217 ec3e6d34462c
child 288 25fe0c8831de
equal deleted inserted replaced
286:6252f951d11c 287:5c7495102bd7
    42    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
    43 */
    43 */
    44    
    44    
    45 IriSP.LayoutManager.prototype.setPopcornInstance = function(popcorn) {
    45 IriSP.LayoutManager.prototype.setPopcornInstance = function(popcorn) {
    46     this._Popcorn = popcorn;
    46     this._Popcorn = popcorn;
    47     /* FIXME - don't forget to add the popcorn messages handlers there */
       
    48 }
    47 }
    49 
    48 
    50 IriSP.LayoutManager.prototype.createDiv = function() {
    49 IriSP.LayoutManager.prototype.createDiv = function() {
    51     var newDiv = Popcorn.guid(this._div + "_widget_");
    50     var newDiv = Popcorn.guid(this._div + "_widget_");
       
    51     var spacerDiv = Popcorn.guid("_spacer_");
    52     this._widgets.push(newDiv);
    52     this._widgets.push(newDiv);
    53 
    53 
    54     var templ = "<div id='{{id}}' style='width: 100%; position: relative;'></div";
    54     var divTempl = "<div id='{{id}}' style='width: 100%; position: relative;'></div";
    55     var txt = Mustache.to_html(templ, {id: newDiv});
    55     var spacerTempl = "<div id='{{spacer_id}}' style='width: 100%; position: relative; height: 5px;'></div";
    56     this.selector.append(txt);
       
    57     
    56     
    58     return newDiv;
    57     var divCode = Mustache.to_html(divTempl, {id: newDiv});
       
    58     var spacerCode = Mustache.to_html(spacerTempl, {spacer_id: spacerDiv});
       
    59 
       
    60     this.selector.append(spacerCode);
       
    61     this.selector.append(divCode);
       
    62     
       
    63     return [newDiv, spacerDiv];
    59 };
    64 };