From 7e344419330855dbbf10896c39e91b4e6861dd57 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 1 Apr 2021 17:30:37 +0200 Subject: displaying custom cursors on the frontend --- frontend/app/views/tile/forms/tile.constants.js | 1 + frontend/app/views/tile/forms/tile.form.hyperlink.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'frontend/app/views/tile/forms') diff --git a/frontend/app/views/tile/forms/tile.constants.js b/frontend/app/views/tile/forms/tile.constants.js index f2dd0ad..d7dea31 100644 --- a/frontend/app/views/tile/forms/tile.constants.js +++ b/frontend/app/views/tile/forms/tile.constants.js @@ -58,6 +58,7 @@ export const CURSORS = [ { name: 'hand_left', label: 'Left', }, { name: 'hand_right', label: 'Right', }, { name: 'unclickable', label: 'Unclickable', }, + { name: 'custom', label: 'Custom', } ] export const MARQUEE_DIRECTIONS = [ diff --git a/frontend/app/views/tile/forms/tile.form.hyperlink.js b/frontend/app/views/tile/forms/tile.form.hyperlink.js index c444748..4d3e0b5 100644 --- a/frontend/app/views/tile/forms/tile.form.hyperlink.js +++ b/frontend/app/views/tile/forms/tile.form.hyperlink.js @@ -11,12 +11,18 @@ import { NO_POPUP, OPEN_POPUP_LINK, CLOSE_POPUP_LINK } from './tile.constants' -export default function TileHyperlinkForm({ tile, pageList, popupList, parent }) { +export default function TileHyperlinkForm({ tile, pageList, popupList, cursors, parent }) { const isExternalLink = tile.target_page_id === EXTERNAL_LINK // const isPopupLink = ( // tile.target_page_id === OPEN_POPUP_LINK || // tile.target_page_id === CLOSE_POPUP_LINK // ) + let cursor + console.log(tile.settings.cursor, tile.settings.custom_cursor_id) + if (tile.settings.cursor === 'custom' && tile.settings.custom_cursor_id) { + cursor = cursors[tile.settings.custom_cursor_id] + console.log(cursor) + } return (
@@ -36,6 +42,9 @@ export default function TileHyperlinkForm({ tile, pageList, popupList, parent }) onChange={parent.handleSettingsSelect} />
+ {cursor && ( + + )} {isExternalLink && (