diff options
Diffstat (limited to 'frontend/app/views/tile/components/tile.form.js')
| -rw-r--r-- | frontend/app/views/tile/components/tile.form.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/frontend/app/views/tile/components/tile.form.js b/frontend/app/views/tile/components/tile.form.js index 372cd1d..b50af2f 100644 --- a/frontend/app/views/tile/components/tile.form.js +++ b/frontend/app/views/tile/components/tile.form.js @@ -54,6 +54,7 @@ class TileForm extends Component { modified: false, pageList: [], popupList: [], + cursors: {}, } constructor(props){ @@ -88,7 +89,13 @@ class TileForm extends Component { ...POPUP_LIST_TOP_OPTIONS, ...Object.keys(page.editor.popups).map(popup_group => ({ name: popup_group, label: popup_group })) ] - this.setState({ pageList, popupList }) + let cursors = this.props.graph.show.res.uploads + .filter(upload => upload.tag === 'cursor') + .reduce((a,b) => { + a[b.id] = b + return a + }, {}) + this.setState({ pageList, popupList, cursors }) if (isNew) { const newTile = TILE_CONSTRUCTORS.image({ id: "new", @@ -110,6 +117,10 @@ class TileForm extends Component { errorFields: new Set([]), }) } + if (this.props.page.editor.pickedCursor !== prevProps.page.editor.pickedCursor) { + console.log("cursor >>", this.props.page.editor.pickedCursor.id) + this.handleSettingsSelect('custom_cursor_id', this.props.page.editor.pickedCursor.id) + } } componentWillUnmount() { @@ -175,6 +186,9 @@ class TileForm extends Component { [name]: value, } }) + if (name === 'cursor' && value === 'custom') { + this.props.pageActions.toggleCursorList(true) + } } handleAlignment(name, value) { @@ -315,6 +329,7 @@ class TileForm extends Component { <TileHyperlinkForm tile={temporaryTile} errorFields={errorFields} parent={this} pageList={this.state.pageList} popupList={this.state.popupList} + cursors={this.state.cursors} /> <TileMiscForm tile={temporaryTile} errorFields={errorFields} parent={this} /> <TileSoundForm tile={temporaryTile} errorFields={errorFields} parent={this} /> |
