3 * The SVG element.. - with a 'g' subelement, that can handle moving / panning etc..
6 * The SVG element is the only element that handles events
7 * if you click on it, it will look for roo-svg-observable in the event handler and pass on events to children.
13 Roo.namespace('Roo.svg');
15 Roo.svg.Element = function(cfg)
17 Roo.svg.Element.superclass.constructor.call(this, cfg);
26 Roo.extend(Roo.svg.Element, Roo.Component, {
32 getAutoCreate : function(){
37 xmlns: "http://www.w3.org/2000/svg",
39 cls : this.cls + ' roo-svg-observable'
43 initEvents: function()
45 Roo.svg.Canvas.superclass.initEvents.call(this);
47 this.el.relayEvent('click', this);
48 this.el.relayEvent('dblclick', this);
49 this.el.relayEvent('context', this);
54 onRender : function(ct, position)
56 // Roo.log("Call onRender: " + this.xtype);
58 Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
61 if (this.el.attr('xtype')) {
62 this.el.attr('xtypex', this.el.attr('xtype'));
63 this.el.dom.removeAttribute('xtype');
73 var cfg = Roo.apply({}, this.getAutoCreate());
75 cfg.id = this.id || Roo.id();
77 // fill in the extra attributes
78 if (this.xattr && typeof(this.xattr) =='object') {
79 for (var i in this.xattr) {
80 cfg[i] = this.xattr[i];
85 cfg.dataId = this.dataId;
89 cfg.cls = (typeof(cfg.cls) == 'undefined') ? this.cls : cfg.cls + ' ' + this.cls;
92 if (this.style) { // fixme needs to support more complex style data.
93 cfg.style = this.style;
100 this.el = ct.createChild(cfg, position);
103 this.tooltipEl().attr('tooltip', this.tooltip);
106 if(this.tabIndex !== undefined){
107 this.el.dom.setAttribute('tabIndex', this.tabIndex);