From d621365d3632b294c2c47f424786415c01c4cdf5 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 20 Mar 2021 15:10:12 +0100 Subject: add popup forms --- frontend/app/views/tile/components/tile.form.js | 44 ++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'frontend/app/views/tile/components/tile.form.js') diff --git a/frontend/app/views/tile/components/tile.form.js b/frontend/app/views/tile/components/tile.form.js index 49b34b1..7d0780d 100644 --- a/frontend/app/views/tile/components/tile.form.js +++ b/frontend/app/views/tile/components/tile.form.js @@ -65,10 +65,14 @@ const CURSORS = [ const NO_LINK = 0 const EXTERNAL_LINK = -1 +const OPEN_POPUP_LINK = -2 +const CLOSE_POPUP_LINK = -2 const PAGE_LIST_TOP_OPTIONS = [ { name: NO_LINK, label: 'No link' }, { name: EXTERNAL_LINK, label: 'External link' }, - { name: -2, label: '──────────', disabled: true }, + { name: OPEN_POPUP_LINK, label: 'Open popup' }, + { name: CLOSE_POPUP_LINK, label: 'Close popup' }, + { name: -3, label: '──────────', disabled: true }, ] // target_page_id = Column(Integer, ForeignKey('page.id'), nullable=True) @@ -754,6 +758,10 @@ class TileForm extends Component { const { temporaryTile } = this.props const { pageList } = this.state const isExternalLink = temporaryTile.target_page_id === EXTERNAL_LINK + const isPopupLink = ( + temporaryTile.target_page_id === OPEN_POPUP_LINK || + temporaryTile.target_page_id === CLOSE_POPUP_LINK + ) return (
@@ -860,6 +868,40 @@ class TileForm extends Component { step={1} type='int' /> + + {temporaryTile.settings.is_popup && ( + + )} + + {temporaryTile.settings.wait_to_appear && ( + + )}
) } -- cgit v1.2.3-70-g09d2