]> _ Git - fluidbook_tools.git/commitdiff
wip #6518 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 27 Nov 2023 17:17:39 +0000 (18:17 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 27 Nov 2023 17:17:39 +0000 (18:17 +0100)
src/Links/ContentLink.php
src/Links/Link.php

index 0070b147d797999a1078d824d5598af2f57fb575..199ba3e0d67b803c6e82efdc7ee4d0e00d591d81 100644 (file)
@@ -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'];
index 555001b4cb5433a7dee06bf5588aa9544900aacf..f0d4013f761c20ec46a54d6a8b6bf545e797eb71 100644 (file)
@@ -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()
     {