]> _ Git - cubeextranet.git/commitdiff
wait #4591 @1.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 12 Jul 2021 16:44:23 +0000 (16:44 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 12 Jul 2021 16:44:23 +0000 (16:44 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 3f56205e9a6b2db8cb60678f9bdb4fd3471a4c97..e70193ebe7095e49a6b3a747aa4e8132f972253f 100644 (file)
@@ -1722,17 +1722,13 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
                 $linkData = wsLinks::decryptLink($linkData);
                 $animations = contentLink::parseAnimations($linkData['image_rollover']);
                 foreach ($animations as $animation) {
-                    if (isset($animation['backgroundcolor']) && $animation['backgroundcolor'] != 'transparent') {
+                    if (isset($animation['backgroundcolor']) && $animation['backgroundcolor'] !== 'transparent') {
                         $dupData = $linkData;
                         $dupData['type'] = 14;
                         $dupData['to'] = $animation['backgroundcolor'];
 
                         $dupData['uid'] = 'b_' . $linkData['uid'];
-                        if (!isset($animation['zindex'])) {
-                            $animation['zindex'] = 0;
-                        }
-                        $z = intval($animation['zindex']) - 1;
-                        $dupData['image_rollover'] = 'zindex=' . $z;
+                        $dupData['image_rollover'] = 'addzindex=-1';
                         array_push($links, $dupData);
                         array_push($links, $linkData);
                         unset($links[$k]);
@@ -1918,6 +1914,12 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
 
     }
 
+    public function getBookSurface()
+    {
+        $s = $this->width * $this->height;
+        return $s;
+    }
+
     protected function _sortLinksByDepth($a, $b)
     {
         $c = $a->getDepth() - $b->getDepth();
index 69108a61c00079e4316d03cfb277f4943ab853a8..2b547b571dfb1391a303e97f2fd524c2e0be5477 100644 (file)
@@ -39,6 +39,7 @@ class wsHTML5Link
     public $hidden = false;
     public $defaultZIndex = 70;
     public $zindex = -1;
+    public $addzindex = 0;
     public $rightClone = false;
     public $iframeType = "none";
     public $border = 0;
@@ -550,13 +551,13 @@ class wsHTML5Link
 
     public function getCSSZIndex()
     {
-        $zindex = $this->getAddZIndex() + (($this->getDepth() + 1) * 1000) - min(999, round(999 * (($this->width * $this->height) / ($this->compiler->width * 2 * $this->compiler->height))));
+        $zindex = $this->getAddZIndex() + (($this->getDepth() + 1) * 10000) - min(9999, max(1, round(9999 * (($this->width * $this->height) / $this->compiler->getBookSurface()))));
         return 'z-index:' . $zindex . ';';
     }
 
     public function getAddZIndex()
     {
-        return 0;
+        return $this->addzindex;
     }
 
     public function moveOnEvenPage()
@@ -967,6 +968,9 @@ class contentLink extends wsHTML5Link
             if (isset($animation['zindex'])) {
                 $this->zindex = $animation['zindex'];
             }
+            if (isset($animation['addzindex'])) {
+                $this->addzindex = $animation['addzindex'];
+            }
         }
         $res .= ' data-animations="' . htmlspecialchars(json_encode($animations), ENT_QUOTES) . '" ';
         if ($this->_isHiddenFirst($animations)) {