Constructor
new SVGContainer(optsopt)
Creates svgext.SVGContainer instance
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
<optional> |
Properties
|
- Mixes In:
- Source:
Extends
Members
(constant) NS :String
SVG namespace
Type:
- String
- Inherited From:
- Default Value:
- http://www.w3.org/2000/svg
- Source:
Methods
activate() → {SVGElement}
Adds an active class
- Inherited From:
- 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 |
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
append(svgElem) → {SVGBlock}
Appends an element
Parameters:
Name | Type | Description |
---|---|---|
svgElem |
SVGElement |
- Mixes In:
- Source:
Returns:
- Type
- SVGBlock
appendElem(node)
Appends svg node
Parameters:
Name | Type | Description |
---|---|---|
node |
SVGNode |
- Mixes In:
- Source:
attr(key, valueopt) → {SVGElement}
SVGElement node attributes setter & getter
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String | ||
value |
String |
<optional> |
- Inherited From:
- Source:
Fires:
- svgext.SVGElement#event:change[ATTR_NAME]
Returns:
- Type
- SVGElement
bringToFront() → {SVGElement}
Brings an element above another
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
deactivate() → {SVGElement}
Removes an active class
- Inherited From:
- Source:
Fires:
- svgext.SVGElement#event:deactivated
Returns:
- Type
- SVGElement
deactivateActiveElement() → {SVGContainer}
Deactivates active element if it exists
- Source:
Returns:
- Type
- SVGContainer
destroy()
Destroys an object
- Overrides:
- Source:
emit(type, …arguments)
Emits custom event on the element
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
String | ||
arguments |
* |
<repeatable> |
- Inherited From:
- Source:
getActiveElement() → {SVGElement|null}
Current active element getter
- Source:
Returns:
- Type
- SVGElement | null
getContainerRect() → {TextRectangle}
Svg container bounding client rect getter
- Inherited From:
- Source:
Returns:
- Type
- TextRectangle
getInstances(elemClassopt) → {Array.<SVGElement>}
Instances getter
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
elemClass |
SVGElement |
<optional> |
- Source:
Returns:
- Type
- Array.<SVGElement>
getRect() → {TextRectangle}
Element bounding client rect getter
- Inherited From:
- Source:
Returns:
- Type
- TextRectangle
hasClass(className) → {Boolean}
Checks if instance has a class
Parameters:
Name | Type | Description |
---|---|---|
className |
String |
- Inherited From:
- Source:
Returns:
- Type
- Boolean
hide() → {SVGElement}
Hides an elment
- Overrides:
- Source:
Returns:
- Type
- SVGElement
off(type, listener) → {SVGElement}
Removes an event listener
Parameters:
Name | Type | Description |
---|---|---|
type |
String | Event name |
listener |
function | Event handler |
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
offDoubleTap(tap) → {SVGElement}
Removes double tap event handler
Parameters:
Name | Type | Description |
---|---|---|
tap |
function |
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
on(type, listener) → {SVGElement}
Adds an event listener
Parameters:
Name | Type | Description |
---|---|---|
type |
String | Event name |
listener |
function | Event handler |
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
onAppend(container)
Fires when an element is appended to the DOM
Parameters:
Name | Type | Description |
---|---|---|
container |
SVGBlock | New element container |
- Inherited From:
- Source:
onDoubleTap(listener) → {function}
Adds double tap event handler
Parameters:
Name | Type | Description |
---|---|---|
listener |
function |
- Inherited From:
- Source:
Returns:
- Type
- function
remove(svgElem) → {SVGBlock}
Removes an svg element
Parameters:
Name | Type | Description |
---|---|---|
svgElem |
SVGElement |
- Mixes In:
- Source:
Returns:
- Type
- SVGBlock
removeActiveInstance(elemClassopt)
Removes an active instance based on passed constructor
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
elemClass |
SVGElement |
<optional> |
- Source:
removeAllInstances(elemClassopt)
Removes all instances based on passed constructor
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
elemClass |
SVGElement |
<optional> |
- Source:
removeClass(className) → {SVGElement}
Removes class
Parameters:
Name | Type | Description |
---|---|---|
className |
String |
- Inherited From:
- Source:
Returns:
- Type
- SVGElement
removeElem(node)
Removes svg node
Parameters:
Name | Type | Description |
---|---|---|
node |
SVGNode |
- Mixes In:
- Source:
setActiveElement(svgElement)
Sets an active element
Parameters:
Name | Type | Description |
---|---|---|
svgElement |
SVGElement |
- Source:
show() → {SVGElement}
Shows an elment
- Overrides:
- Source:
Returns:
- Type
- SVGElement
toggleAllInstances(visible, elemClassopt) → {SVGContainer}
Toggles elements
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
visible |
Boolean | ||
elemClass |
SVGElement |
<optional> |
- Source:
Returns:
- Type
- SVGContainer