The Widget API: Events
render
Fired whenever a server-side render is performed with one of the REST APIs
Key | Type | Description |
---|---|---|
image |
blob |
The image element currently being managed by the widget. |
crimg |
node |
the cropped image html element |
width |
number |
The natural width of the image managed by the widget |
height |
number |
the natural height of the image being managed by the widget |
isUploading |
boolean |
Whether or not the image is still being uploaded to the widget |
Output
First render gives you a status if the image is still uploading
{
"detail": {
"isUploading": true
}
}
Then it gives you the details of the uploaded image
{
"detail": {
"crimg": img.cr-image ,
"uploading": false ,
"height": 1018 ,
"width": 853
}
}
update
Fired whenever a client-side change is performed
Key | Type | Description |
---|---|---|
points |
array |
Crop coordinates |
zoom |
number |
Scale factor |
Output
Triggers when there is an updated done inside the widget
{
"detail": {
"orientation": 1 ,
"height": 1018 ,
"width": 853 ,
"points": [
"311" ,
"420" ,
"452" ,
"561"
]
}
}
propertychange
Fired whenever one of the TweekIT objects properties changes
Key | Type | Description |
---|---|---|
name |
string |
Name of the property that changed |
oldValue |
any |
Value of property before change |
newValue |
any |
Value of the property after a change |
Output
Triggers when a setter is reassigned with a new value
{
"detail": {
"name": "elliptical" ,
"newValue": true ,
"oldValue": false
}
}