src/js/widgets.js
branchnew-model
changeset 874 38b65761a7d5
parent 872 d777d05a16e4
child 875 43629caa77bc
equal deleted inserted replaced
872:d777d05a16e4 874:38b65761a7d5
    57     this.$.addClass("Ldt-TraceMe").addClass("Ldt-Widget").attr("widget-type", _type);
    57     this.$.addClass("Ldt-TraceMe").addClass("Ldt-Widget").attr("widget-type", _type);
    58     
    58     
    59     /* Does the widget require other widgets ? */
    59     /* Does the widget require other widgets ? */
    60     if (typeof this.requires !== "undefined") {
    60     if (typeof this.requires !== "undefined") {
    61         for (var _i = 0; _i < this.requires.length; _i++) {
    61         for (var _i = 0; _i < this.requires.length; _i++) {
    62             var _subconfig = this.requires[_i],
    62             var _subconfig = this.requires[_i];
    63                 _div = IriSP.jQuery('<div>');
    63             if (typeof IriSP[_subconfig.type] !== "undefined") {
    64             _subconfig.container = IriSP._.uniqueId(this.container + '_' + _subconfig.type + '_');
    64                 _subconfig.container = IriSP._.uniqueId(this.container + '_' + _subconfig.type + '_');
    65             _div.id = _subconfig.container;
    65                 this.$.append(IriSP.jQuery('<div>').attr("id",_subconfig.container));
    66             this.$.append(_div);
    66                 console.log(this.$.html());
    67             this[_subconfig.type] = new IriSP.Widgets(player, _subconfig);
    67                 this[_subconfig.type] = new IriSP[_subconfig.type](player, _subconfig);
       
    68             } else {
       
    69                 console.log("Error, Call to Undefined Widget Type : "+_subconfig.type);
       
    70             }
    68         }
    71         }
    69     }
    72     }
    70     
    73     
    71 };
    74 };
    72 
    75