|
|
|
@ -28,7 +28,15 @@ const layers = editor.Layers; |
|
|
|
|
|
|
|
* [setRoot][1] |
|
|
|
* [getRoot][2] |
|
|
|
* [getLayerData][3] |
|
|
|
* [getComponents][3] |
|
|
|
* [setOpen][4] |
|
|
|
* [isOpen][5] |
|
|
|
* [setVisible][6] |
|
|
|
* [isVisible][7] |
|
|
|
* [setlocked][8] |
|
|
|
* [isLocked][9] |
|
|
|
* [setName][10] |
|
|
|
* [getLayerData][11] |
|
|
|
|
|
|
|
[Page]: page.html |
|
|
|
|
|
|
|
@ -40,7 +48,7 @@ Update root layer with another component. |
|
|
|
|
|
|
|
### Parameters |
|
|
|
|
|
|
|
* `component` **([Component] | [String][4])** Component to be set as root |
|
|
|
* `component` **([Component] | [String][12])** Component to be set as root |
|
|
|
|
|
|
|
### Examples |
|
|
|
|
|
|
|
@ -63,77 +71,132 @@ const layerRoot = layers.getRoot(); |
|
|
|
|
|
|
|
Returns **[Component]** |
|
|
|
|
|
|
|
## getLayerData |
|
|
|
## getComponents |
|
|
|
|
|
|
|
Get layer data from a component. |
|
|
|
Get valid layer child components (eg. excludes non layerable components). |
|
|
|
|
|
|
|
### Parameters |
|
|
|
|
|
|
|
* `component` **[Component]** Component from which you want to read layer data. |
|
|
|
* `component` **[Component]** Component from which you want to get child components |
|
|
|
|
|
|
|
### Examples |
|
|
|
|
|
|
|
```javascript |
|
|
|
const component = editor.getSelected(); |
|
|
|
const layerData = layers.getLayerData(component); |
|
|
|
console.log(layerData); |
|
|
|
const components = layers.getComponents(component); |
|
|
|
console.log(components); |
|
|
|
``` |
|
|
|
|
|
|
|
Returns **LayerData** Object containing layer data |
|
|
|
Returns **[Array][13]<[Component]>** |
|
|
|
|
|
|
|
## setOpen |
|
|
|
|
|
|
|
Update the layer open state of the component. |
|
|
|
|
|
|
|
### Parameters |
|
|
|
|
|
|
|
* `component` **[Component]** Component to update |
|
|
|
* `value` **[Boolean][14]** |
|
|
|
|
|
|
|
## isOpen |
|
|
|
|
|
|
|
Check the layer open state of the component. |
|
|
|
|
|
|
|
### Parameters |
|
|
|
|
|
|
|
* `component` **[Component]** |
|
|
|
|
|
|
|
Returns **[Boolean][14]** |
|
|
|
|
|
|
|
## setVisible |
|
|
|
|
|
|
|
Update component visibility |
|
|
|
Update the layer visibility state of the component. |
|
|
|
|
|
|
|
### Parameters |
|
|
|
|
|
|
|
* `component` **Component** |
|
|
|
* `value` **[boolean][5]** |
|
|
|
* `component` **[Component]** Component to update |
|
|
|
* `value` **[Boolean][14]** |
|
|
|
|
|
|
|
## isVisible |
|
|
|
|
|
|
|
Check if the component is visible |
|
|
|
Check the layer visibility state of the component. |
|
|
|
|
|
|
|
### Parameters |
|
|
|
|
|
|
|
* `component` **Component** |
|
|
|
* `component` **[Component]** |
|
|
|
|
|
|
|
Returns **[boolean][5]** |
|
|
|
Returns **[Boolean][14]** |
|
|
|
|
|
|
|
## setLocked |
|
|
|
|
|
|
|
Update component locked value |
|
|
|
Update the layer locked state of the component. |
|
|
|
|
|
|
|
### Parameters |
|
|
|
|
|
|
|
* `component` **Component** |
|
|
|
* `value` **[boolean][5]** |
|
|
|
* `component` **[Component]** Component to update |
|
|
|
* `value` **[Boolean][14]** |
|
|
|
|
|
|
|
## isLocked |
|
|
|
|
|
|
|
Check if the component is locked |
|
|
|
Check the layer locked state of the component. |
|
|
|
|
|
|
|
### Parameters |
|
|
|
|
|
|
|
* `component` **Component** |
|
|
|
* `component` **[Component]** |
|
|
|
|
|
|
|
Returns **[boolean][5]** |
|
|
|
Returns **[Boolean][14]** |
|
|
|
|
|
|
|
## setName |
|
|
|
|
|
|
|
Update component name |
|
|
|
Update the layer name state of the component. |
|
|
|
|
|
|
|
### Parameters |
|
|
|
|
|
|
|
* `component` **[Component]** Component to update |
|
|
|
* `value` **[String][12]** New name |
|
|
|
|
|
|
|
## getLayerData |
|
|
|
|
|
|
|
Get layer data from a component. |
|
|
|
|
|
|
|
### Parameters |
|
|
|
|
|
|
|
* `component` **Component** |
|
|
|
* `value` **[string][4]** |
|
|
|
* `component` **[Component]** Component from which you want to read layer data. |
|
|
|
|
|
|
|
### Examples |
|
|
|
|
|
|
|
```javascript |
|
|
|
const component = editor.getSelected(); |
|
|
|
const layerData = layers.getLayerData(component); |
|
|
|
console.log(layerData); |
|
|
|
``` |
|
|
|
|
|
|
|
Returns **LayerData** Object containing layer data |
|
|
|
|
|
|
|
[1]: #setroot |
|
|
|
|
|
|
|
[2]: #getroot |
|
|
|
|
|
|
|
[3]: #getlayerdata |
|
|
|
[3]: #getcomponents |
|
|
|
|
|
|
|
[4]: #setopen |
|
|
|
|
|
|
|
[5]: #isopen |
|
|
|
|
|
|
|
[6]: #setvisible |
|
|
|
|
|
|
|
[7]: #isvisible |
|
|
|
|
|
|
|
[8]: #setlocked |
|
|
|
|
|
|
|
[9]: #islocked |
|
|
|
|
|
|
|
[10]: #setname |
|
|
|
|
|
|
|
[11]: #getlayerdata |
|
|
|
|
|
|
|
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String |
|
|
|
|
|
|
|
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String |
|
|
|
[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array |
|
|
|
|
|
|
|
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean |
|
|
|
[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean |
|
|
|
|