@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
38 lines (31 loc) • 1.2 kB
Markdown
Command: setRemoteMockup
========================
Like [**changeMockup**](change-mockup.md), this command replaces the mockup image in the editor. However, instead of a path on the Customer's Canvas back end, this method takes a URL to a remote image you want to insert. It is extremely useful when the mockup image is _generated_.
_**Important!** This method works only if you already specified a regular image, not a PSD file, as a mockup in the [**initial** command](initial.md)._
## Params
`setRemoteMockup` takes an array of objects with the following parameters:
- `surfaceIndex` - which surface to modify. If omitted, the currently visible surface is modified.
- `mockup` - either `up` or `down`, which stands for overlaying and background mockups.
- `url` - a URL to the image to use as a mockup
## Example
``` js
{
"type": "ajax",
"name": "mockup-recolor",
"params": {
...
}
},
{
"type": "design-editor",
"name": "editor",
"params": {
"initial": { ... },
"setRemoteMockup": [{
"surfaceIndex": 0,
"mockup": "down",
"url": "{{ $['mockup-recolor'].response || '' }}"
}]
}
}
```