]> _ Git - cubeextranet.git/commitdiff
wait #4532 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 10 Jun 2021 16:12:07 +0000 (16:12 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 10 Jun 2021 16:12:07 +0000 (16:12 +0000)
inc/ws/Util/html5/master/class.ws.html5.links.php

index 2094144e9e72029207f2ded01b555c7c0d4c00e3..86f468457123d75d7b9614f676142445c2b8e57b 100644 (file)
@@ -44,6 +44,7 @@ class wsHTML5Link
     public $borderColor = '#ffffff';
     public $maxWidth = 0;
     public $wdir;
+    public $initialOrder = 0;
     public $gamifyCoins = 0;
     public $tooltipColor = null;
     public $tooltipBackgroundColor = null;
@@ -380,6 +381,22 @@ class wsHTML5Link
         $this->init();
     }
 
+    /**
+     * @param int $initialOrder
+     */
+    public function setInitialOrder(int $initialOrder): void
+    {
+        $this->initialOrder = $initialOrder;
+    }
+
+    /**
+     * @return int
+     */
+    public function getInitialOrder(): int
+    {
+        return $this->initialOrder;
+    }
+
     public function getDepth()
     {
         if ($this->zindex == -1 || null === $this->zindex || !$this->zindex) {
@@ -526,10 +543,15 @@ class wsHTML5Link
 
     public function getCSSZIndex()
     {
-        $zindex = (($this->getDepth() + 1) * 1000) - min(999, round(($this->width * $this->height) / 300));
+        $zindex = $this->getAddZIndex() + (($this->getDepth() + 1) * 1000) - min(999, round(($this->width * $this->height) / 300));
         return 'z-index:' . $zindex . ';';
     }
 
+    public function getAddZIndex()
+    {
+        return 0;
+    }
+
     public function moveOnEvenPage()
     {
         return false;
@@ -906,6 +928,7 @@ class htmlMultimediaPopupImage extends normalLink
 class contentLink extends wsHTML5Link
 {
     public $defaultZIndex = 30;
+    public $animZindex = 0;
 
     public function getHTMLContainerClass()
     {
@@ -917,9 +940,9 @@ class contentLink extends wsHTML5Link
         $res = parent::getAdditionnalContent();
         $animations = self::parseAnimations($this->image_rollover);
         foreach ($animations as $animation) {
-//            if (isset($animation['zindex'])) {
-//                $this->defaultZIndex = $animation['zindex'];
-//            }
+            if (isset($animation['zindex'])) {
+                $this->animZindex = $animation['zindex'];
+            }
         }
         $res .= ' data-animations="' . htmlspecialchars(json_encode($animations), ENT_QUOTES) . '" ';
         if ($this->_isHiddenFirst($animations)) {
@@ -939,6 +962,11 @@ class contentLink extends wsHTML5Link
         }
         return false;
     }
+
+    public function getAddZIndex()
+    {
+        return parent::getAddZIndex() + $this->animZindex;
+    }
 }
 
 class eventOverlayLink extends wsHTML5Link