Controller.Action

Related

Controller, Controller.Params

Functions created by the controller that typically respond to events.

Class Methods

These methods can be called on generated controller classes, i.e. TodosController

Controller.Action

new Controller.Action(name, func,className) -> Controller.Action

Creates a new controller action.

- The function name. Typically these will be event types like "click", "mouseover", and event types and css selectors like "a.delete click".
- The function to call back if the name includes an event type.
- The className of the action's Controller.

Prototype Methods

selector_order

controller_action.selector_order() -> Array

Returns the parsed selector part of the Controller.Action converted into objects that represent its ordering.

node_path

selector_order.node_path(el) -> Array

Returns an array of objects that represent the path of the node to document.body.

match

selector_order.match(element) -> false or HTMLElement

If the controller action's selector matches the element, returns the highest parent element of element where the match occurs. If the element is not matched by the action's selector, it returns false;