]> _ Git - fluidbook_tools.git/commitdiff
wip #7650 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 18 Jul 2025 14:56:19 +0000 (16:56 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 18 Jul 2025 14:56:19 +0000 (16:56 +0200)
src/Links/Link.php
src/Links/NormalLink.php

index 5045bff3511f2790ef8857a9fd326b2a31306a52..101e5c6d6ef7a3b4be32f23aff1b4928aa7609b5 100644 (file)
@@ -186,6 +186,7 @@ class Link
         $init = ArrayUtil::asArray($init);
 
         static::normalizeDimensions($init);
+        static::normalizeArea($init);
 
         $init['scorm'] = static::isScorm($init);
         $init['to'] = static::replaceCustomURL($init['to']);
@@ -383,6 +384,23 @@ class Link
         }
     }
 
+    public static function normalizeArea(&$a)
+    {
+        if (!isset($a['display_area'])) {
+            $a['display_area'] = 'fill';
+        }
+        if ($a['display_area'] == '0' || !$a['display_area']) {
+            $a['display_area'] = 'none';
+        }
+        if ($a['display_area'] == '1') {
+            $a['display_area'] = 'fill';
+        }
+
+        if (!isset($a['animate_area'])) {
+            $a['animate_area'] = 'default';
+        }
+    }
+
     public function getSurface()
     {
         return $this->width * $this->height;
index 6d574889091d6b6d503cdbb7c1c7a6919f7c952f..d01807bb0b70e66d4230693d478a2601a95365aa 100644 (file)
@@ -15,14 +15,13 @@ class NormalLink extends Link
     {
         $class = $this->getClasses();
         $attrs = '';
-        if ($this->display_area) {
-            if ($this->compiler->getSetting('linksAnimationLayer', 'top') === 'top' || $this->compiler->getSetting('linksAnimation', 'fade') === 'fade') {
-                $class[] = 'displayArea';
-                $attrs .= ' data-animation="' . $this->getAnimationType() . '"';
-            } else {
-                $attrs .= ' data-display-area=""';
-            }
+        if ($this->compiler->getSetting('linksAnimationLayer', 'top') === 'top') {
+            $attrs .= ' data-animation="' . $this->getAnimationType() . '"';
+            $attrs .= ' data-display-area="' . $this->display_area . '" ';
+        } else {
+            $attrs .= ' data-display-area="none" ';
         }
+
         if (count($class)) {
             $attrs .= ' class="' . implode(' ', $class) . '"';
         }