From 19cf3a296741b92548849b1f40e0d3cc517f2fcc Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 20 Mar 2021 22:14:21 +0100 Subject: dimensions based on video --- frontend/app/views/tile/components/tile.form.js | 32 +++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-) (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 b33f7b8..3066da3 100644 --- a/frontend/app/views/tile/components/tile.form.js +++ b/frontend/app/views/tile/components/tile.form.js @@ -64,6 +64,14 @@ const CURSORS = [ { name: 'unclickable', label: 'Unclickable', }, ] +const UNITS = [ + { name: 'px', label: 'pixels' }, + { name: '%', label: 'percent' }, + { name: 'video', label: 'video' }, + { name: 'vmin', label: 'screen min' }, + { name: 'vmax', label: 'screen max' }, +] + const NO_LINK = 0 const EXTERNAL_LINK = -1 const OPEN_POPUP_LINK = -2 @@ -95,7 +103,7 @@ const newImage = (data) => ({ cursor: 'hand_up', }, type: 'image', - target_page_id: null, + target_page_id: 0, ...data, }) @@ -114,7 +122,7 @@ const newVideo = (data) => ({ loop_end: 0, }, type: 'video', - target_page_id: null, + target_page_id: 0, ...data, }) @@ -134,7 +142,7 @@ const newText = (data) => ({ cursor: 'hand_up', }, type: 'text', - target_page_id: null, + target_page_id: 0, ...data, }) @@ -146,7 +154,7 @@ const newLink = (data) => ({ units: 'px', }, type: 'link', - target_page_id: null, + target_page_id: 0, ...data, }) @@ -395,6 +403,7 @@ class TileForm extends Component { } else { validData.id = temporaryTile.id } + validData.target_page_id = validData.target_page_id || 0 this.setState({ modified: false }) console.log('submit', validData) onSubmit(validData) @@ -734,14 +743,13 @@ class TileForm extends Component { autoComplete="off" /> -
- +