Component events
Component events
When components are moved around the page in Edit mode, Fliplet provides a set of events to manage the user interaction.
Usage
Fliplet.Hooks.on('componentEvent', function(event) {
console.log(event.type); // Event type
});
Parameters
Fliplet.Hooks.on('componentEvent', fn);
fn
(Function(event
)) Required Callback function to process the eventevent
(Object)type
(String) Type of component eventPossible values
adding
- Component is being addedadded
- Component is successfully addedaddFailed
- Component failed to addremoved
- Component removedmoved
- Component movedrender
- Component rendered
target
(ComponentNode) Target node where the component is added to, removed from or moved tosource
(ComponentNode) Where the node is moved from, if the event type ismoved
added
(ComponentNodeList) A list of component nodes addedremoved
(ComponentNodeList) A list of components nodes removed
ComponentNode
A node representing a component or a component view container.
Properties
widgetId
(Number) Widget instance IDhelperId
(String) Helper instance IDpackage
(String) Package name for the widget instancename
(String) Registered widget or helper nameview
(String) Name of a widget or helper view container
Examples
Fliplet.Hooks.on('componentEvent', function(event) {
});