From: Vincent Vanwaelscappel Date: Fri, 18 Jul 2025 14:56:19 +0000 (+0200) Subject: wip #7650 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=81a3490210897f45afd4e6feabfbf52301d536b8;p=fluidbook_tools.git wip #7650 @3 --- diff --git a/src/Links/Link.php b/src/Links/Link.php index 5045bff..101e5c6 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -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; diff --git a/src/Links/NormalLink.php b/src/Links/NormalLink.php index 6d57488..d01807b 100644 --- a/src/Links/NormalLink.php +++ b/src/Links/NormalLink.php @@ -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) . '"'; }