Roo/bootstrap/Element.js
authoredward <edward@roojs.com>
Fri, 13 Nov 2015 05:13:40 +0000 (13:13 +0800)
committeredward <edward@roojs.com>
Fri, 13 Nov 2015 05:13:40 +0000 (13:13 +0800)
Roo/bootstrap/Element.js

index 1301a78..bb4c9f0 100644 (file)
@@ -37,11 +37,31 @@ Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component,  {
             html: this.html
         }
         
-        
-       
         return cfg;
     },
     
+    initEvents: function() 
+    {
+        
+        Roo.bootstrap.Element.superclass.initEvents.call(this);
+        
+        this.el.on('click', this.onClick, this);
+        
+    },
+    
+    onClick : function(e)
+    {
+        if (this.disabled) {
+            return;
+        }
+        
+        if(this.preventDefault){
+            e.preventDefault();
+        }
+        
+        this.fireEvent('click', this, e);
+    },
+    
     getValue : function()
     {
         return this.el.dom.innerHTML;