]> _ Git - cubeextranet.git/commitdiff
WIP #815
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 21 Apr 2017 13:08:14 +0000 (13:08 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 21 Apr 2017 13:08:14 +0000 (13:08 +0000)
inc/ws/Util/html5/class.ws.html5.links.php

index 5870546c1205135bf32002dc50b1ed5c7be2f375..a75a568546ee66af05f83d05ba7d2320a6adfda8 100644 (file)
@@ -1088,9 +1088,68 @@ class zoomLink extends normalLink {
                fb($compiler, 'COMPILER');
        }
 
-       public function getClasses() {
-               return array_merge(['zoomPopup'], parent::getClasses());
-       }
+    public function getAdditionnalContent() {
+        $res  = parent::getAdditionnalContent();
+
+        // Data attributes
+        $attributes = [
+            'maxzoom' => $this->to,
+        ];
+
+        // Set data attributes
+        foreach ($attributes as $key => $val) {
+            $res .= ' data-'.$key.'="'. $val .'"';
+        }
+
+        return $res;
+    }
+
+
+    public function getClasses() {
+        return array_merge(['zoomPopup'], parent::getClasses());
+    }
+
+    public function getCSSContainer() {
+        $css = "
+        #zoomPopupOverlay {
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: 100%;
+            height: 100%;
+            background-color: rgba(0,0,0,0.6);
+            z-index: 100;
+            display: none;
+        }
+        
+        body.zoomPopup #zoomPopupOverlay {
+            display: block;
+        }
+                                
+        #zoomPopupWrapper {
+              display: none;
+              background-color: #ffcc00;
+              background-repeat: no-repeat;
+              background-position: center;
+              background-size: cover;
+              transition: all 0.5s ease-in-out;
+              position: absolute;
+              z-index: 101;
+        }
+        
+        .zoomPopupClose {
+            position: absolute;
+            top: 10px;
+            right: 10px;
+            width: 20px;
+            height: 20px;
+            background: url('../images/interface-close.svg') center no-repeat;
+            background-size: contain;
+        }";
+
+        return parent::getCSSContainer() . $css;
+    }
+
 
 
 }
\ No newline at end of file