From ccedbaca14ae1a15be5459856ac5910ffcc43d02 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 27 Nov 2023 18:17:39 +0100 Subject: [PATCH] wip #6518 @0.5 --- src/Links/ContentLink.php | 6 ++++++ src/Links/Link.php | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Links/ContentLink.php b/src/Links/ContentLink.php index 0070b14..199ba3e 100644 --- a/src/Links/ContentLink.php +++ b/src/Links/ContentLink.php @@ -65,6 +65,12 @@ class ContentLink extends Link return $res; } + public function getDelay(): float + { + // Delay is managed by the animation engine + return 0; + } + protected function _isFinallyHidden($animations) { $hiddenAnimations = ['fadeout', 'unmask']; diff --git a/src/Links/Link.php b/src/Links/Link.php index 555001b..f0d4013 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -126,6 +126,10 @@ class Link public $cursor = ''; protected $role = 'button'; + + /** @var float */ + public $delay = 0; + protected $_init; public $relatedAnimation = ''; @@ -640,11 +644,23 @@ class Link if ($this->tooltipColor) { $res .= 'data-tooltip-color="' . $this->tooltipColor . '" '; } + $delay = $this->getDelay(); + if ($delay) { + $res .= 'data-delay="' . $delay . '" '; + } return $res; } + /** + * @return int + */ + public function getDelay(): float + { + return max(0, (float)$this->delay); + } + public function getClasses() { -- 2.39.5