Constructor
(abstract) new SVGElement(optsopt, tag)
Creates svgext.SVGElement instance
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
<optional> |
Properties
|
||||||||||||||||||||
tag |
String | SVGSVGElement |
- Source:
Members
(constant) NS :String
SVG namespace
Type:
- String
- Default Value:
- http://www.w3.org/2000/svg
- Source:
Methods
activate() → {SVGElement}
Adds an active class
- Source:
Fires:
- svgext.SVGElement#event:activated
Returns:
- Type
- SVGElement
addClass(newClass) → {SVGElement}
Adds a new class to the element
Parameters:
Name | Type | Description |
---|---|---|
newClass |
String | Class name or several classes separated by a space |
- Source:
Returns:
- Type
- SVGElement
attr(key, valueopt) → {SVGElement}
SVGElement node attributes setter & getter
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String | ||
value |
String |
<optional> |
- Source:
Fires:
- svgext.SVGElement#event:change[ATTR_NAME]
Returns:
- Type
- SVGElement
bringToFront() → {SVGElement}
Brings an element above another
- Source:
Returns:
- Type
- SVGElement
deactivate() → {SVGElement}
Removes an active class
- Source:
Fires:
- svgext.SVGElement#event:deactivated
Returns:
- Type
- SVGElement
destroy()
Destroys an object
- Source:
emit(type, …arguments)
Emits custom event on the element
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
String | ||
arguments |
* |
<repeatable> |
- Source:
getContainerRect() → {TextRectangle}
Svg container bounding client rect getter
- Source:
Returns:
- Type
- TextRectangle
getRect() → {TextRectangle}
Element bounding client rect getter
- Source:
Returns:
- Type
- TextRectangle
hasClass(className) → {Boolean}
Checks if instance has a class
Parameters:
Name | Type | Description |
---|---|---|
className |
String |
- Source:
Returns:
- Type
- Boolean
hide() → {SVGElement}
Hides an elment
- Source:
Returns:
- Type
- SVGElement
off(type, listener) → {SVGElement}
Removes an event listener
Parameters:
Name | Type | Description |
---|---|---|
type |
String | Event name |
listener |
function | Event handler |
- Source:
Returns:
- Type
- SVGElement
offDoubleTap(tap) → {SVGElement}
Removes double tap event handler
Parameters:
Name | Type | Description |
---|---|---|
tap |
function |
- Source:
Returns:
- Type
- SVGElement
on(type, listener) → {SVGElement}
Adds an event listener
Parameters:
Name | Type | Description |
---|---|---|
type |
String | Event name |
listener |
function | Event handler |
- Source:
Returns:
- Type
- SVGElement
onAppend(container)
Fires when an element is appended to the DOM
Parameters:
Name | Type | Description |
---|---|---|
container |
SVGBlock | New element container |
- Source:
onDoubleTap(listener) → {function}
Adds double tap event handler
Parameters:
Name | Type | Description |
---|---|---|
listener |
function |
- Source:
Returns:
- Type
- function
removeClass(className) → {SVGElement}
Removes class
Parameters:
Name | Type | Description |
---|---|---|
className |
String |
- Source:
Returns:
- Type
- SVGElement
show() → {SVGElement}
Shows an elment
- Source:
Returns:
- Type
- SVGElement