X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=docs%2Fsrc%2FRoo_bootstrap_Element.js.html;fp=docs%2Fsrc%2FRoo_bootstrap_Element.js.html;h=72e83db29e51189648785de3b498d77ed70ecc39;hb=9ff8ded6bbbd258ecd646184ba26020874e2c085;hp=0000000000000000000000000000000000000000;hpb=2542b67d1a0768025056f2f330bfe50b64d1ad38;p=roojs1 diff --git a/docs/src/Roo_bootstrap_Element.js.html b/docs/src/Roo_bootstrap_Element.js.html new file mode 100644 index 0000000000..72e83db29e --- /dev/null +++ b/docs/src/Roo_bootstrap_Element.js.html @@ -0,0 +1,90 @@ +/home/alan/gitlive/roojs1/Roo/bootstrap/Element.js/* + * - LGPL + * + * element + * + */ + +/** + * @class Roo.bootstrap.Element + * @extends Roo.bootstrap.Component + * Bootstrap Element class + * @cfg {String} html contents of the element + * @cfg {String} tag tag of the element + * @cfg {String} cls class of the element + * @cfg {Boolean} preventDefault (true|false) default false + * @cfg {Boolean} clickable (true|false) default false + * + * @constructor + * Create a new Element + * @param {Object} config The config object + */ + +Roo.bootstrap.Element = function(config){ + Roo.bootstrap.Element.superclass.constructor.call(this, config); + + this.addEvents({ + // raw events + /** + * @event click + * When a element is chick + * @param {Roo.bootstrap.Element} this + * @param {Roo.EventObject} e + */ + "click" : true + }); +}; + +Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component, { + + tag: 'div', + cls: '', + html: '', + preventDefault: false, + clickable: false, + + getAutoCreate : function(){ + + var cfg = { + tag: this.tag, + // cls: this.cls, double assign in parent class Component.js :: onRender + html: this.html + }; + + return cfg; + }, + + initEvents: function() + { + Roo.bootstrap.Element.superclass.initEvents.call(this); + + if(this.clickable){ + this.el.on('click', this.onClick, this); + } + + }, + + onClick : function(e) + { + if(this.preventDefault){ + e.preventDefault(); + } + + this.fireEvent('click', this, e); + }, + + getValue : function() + { + return this.el.dom.innerHTML; + }, + + setValue : function(value) + { + this.el.dom.innerHTML = value; + } + +}); + + + + \ No newline at end of file