new ElementProxy(el)
Element Proxy
Wraps an Element to add cross browser or simplified functionality;
think of it as "jQuery nano"
Parameters:
Name | Type | Description |
---|---|---|
el |
Element | Element to be proxied |
Extends
Members
attributes
- Source:
- See:
attributes
- Source:
- See:
cbAttributes
Returns object containing the value of all cb-* attributes on a DOM element
Example
ep.cbAttributes.view;
supro
Similar to `super` in ActionScript or Java, this property enables
you to access properties and methods of the super class prototype,
which is the case of JavaScript is the next prototype up the chain
- Inherited From:
- Source:
Methods
addClass(className) → {conbo.ElementProxy}
Add the specified CSS class(es) to the element
Parameters:
Name | Type | Description |
---|---|---|
className |
string | One or more CSS class names, separated by spaces |
Returns:
- Type
- conbo.ElementProxy
addEventListener(type, handler) → {conbo.EventProxy}
Add a listener for a particular event type
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Type of event ('change') or events ('change blur') |
handler |
function | Function that should be called |
- Inherited From:
- Source:
Returns:
A reference to this class instance
- Type
- conbo.EventProxy
bindAll(…methodNameopt) → {this}
Scope all methods of this class instance to this class instance
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
methodName |
string |
<optional> <repeatable> |
Specific method names to bind (all will be bound if none specified) |
- Inherited From:
- Source:
Returns:
- Type
- this
closest(selector) → {Element}
Finds the closest parent element matching the specified selector
Parameters:
Name | Type | Description |
---|---|---|
selector |
string | Query selector |
Returns:
- Type
- Element
declarations() → {void}
Declarations is used to declare instance properties used by this class
Parameters:
Type | Attributes | Description |
---|---|---|
* |
<repeatable> |
- Inherited From:
- Source:
Returns:
- Type
- void
destroy() → {void}
Clean everything up ready for garbage collection (you should override in your own classes)
- Inherited From:
- Source:
Returns:
- Type
- void
getAttributes() → {Object}
Returns object containing the value of all attributes on a DOM element
Returns:
- Type
- Object
Example
ep.attributes; // results in something like {src:"foo/bar.jpg"}
hasClass(className) → {boolean}
Is this element using the specified CSS class?
Parameters:
Name | Type | Description |
---|---|---|
className |
string | CSS class name |
Returns:
- Type
- boolean
initialize() → {void}
Initialize (entry point) is called immediately after the constructor has completed
Parameters:
Type | Attributes | Description |
---|---|---|
* |
<repeatable> |
- Inherited From:
- Source:
Returns:
- Type
- void
preinitialize() → {void}
Preinitialize is called before any code in the constructor has been run
Parameters:
Type | Attributes | Description |
---|---|---|
* |
<repeatable> |
- Inherited From:
- Source:
Returns:
- Type
- void
removeClass(className) → {conbo.ElementProxy}
Remove the specified CSS class(es) from the element
Parameters:
Name | Type | Description |
---|---|---|
className |
string | function | One or more CSS class names, separated by spaces, or a function extracts the classes to be removed from the existing className property |
Returns:
- Type
- conbo.ElementProxy
removeEventListener(type, handler) → {conbo.EventProxy}
Remove a listener for a particular event type
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Type of event ('change') or events ('change blur') |
handler |
function | Function that should be called |
- Inherited From:
- Source:
Returns:
A reference to this class instance
- Type
- conbo.EventProxy
setAttributes(obj) → {conbo.ElementProxy}
Sets the attributes on a DOM element from an Object, converting camelCase to kebab-case, if needed
Parameters:
Name | Type | Description |
---|---|---|
obj |
Element | Object containing the attributes to set |
Returns:
- Type
- conbo.ElementProxy
Example
ep.setAttributes({foo:1, bar:"red"});
toString() → {string}
String representation of the current class
- Inherited From:
- Source:
Returns:
- Type
- string