X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-bootstrap-debug.js;h=ce4ffe5ce9254ffafa205044465195b1a6024f42;hb=946f16ecf07aa8f3240ab0870c15764abe349eb4;hp=3bdf91e958d9e499b24fd5ae4068fd1630d9493f;hpb=05f63121a702d6371b0be050c098f2afd2f72bd1;p=roojs1 diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 3bdf91e958..ce4ffe5ce9 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -435,6 +435,95 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { } }); + /* + * - 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; + } + +}); + + + /* * - LGPL * @@ -5632,95 +5721,6 @@ Roo.extend(Roo.bootstrap.Row, Roo.bootstrap.Component, { - /* - * - 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; - } - -}); - - - /* * - LGPL *