Roo/svg/Canvas.js
authorAlan Knowles <alan@roojs.com>
Wed, 23 Jun 2021 05:56:47 +0000 (13:56 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 23 Jun 2021 05:56:47 +0000 (13:56 +0800)
Roo/svg/Canvas.js

index 1a368f8..b7b4cf3 100644 (file)
@@ -22,7 +22,39 @@ Roo.svg.Canvas = function(cfg)
 
 Roo.extend(Roo.svg.Canvas, Roo.BoxComponent,  {
    
-   
+    getAutoCreate : function(){
+        
+        var cfg = {
+            tag: this.tag,
+            // cls: this.cls, double assign in parent class Component.js :: onRender
+            html: this.html
+        };
+        return {
+            ns: "svg",
+            xmlns: "http://www.w3.org/2000/svg",
+            tag: "svg",
+            width: this.wrapper.dom.clientWidth,
+            height: this.wrapper.dom.clientHeight,
+            cn : [
+                {
+                    ns: "svg",
+                    tag: "g",
+                    focusable : 'true'
+                }
+            ]
+        };
+    },
+    
+    initEvents: function() 
+    {
+        Roo.bootstrap.Element.superclass.initEvents.call(this);
+        
+        if(this.clickable){
+            this.el.on('click', this.onClick, this);
+        }
+        
+        
+    },
    
    
 });
\ No newline at end of file