From: stephen@cubedesigners.com Date: Fri, 21 Apr 2017 13:08:14 +0000 (+0000) Subject: WIP #815 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=314c378d03b3dae4c3b91744af9df7b9c561c10d;p=cubeextranet.git WIP #815 --- diff --git a/inc/ws/Util/html5/class.ws.html5.links.php b/inc/ws/Util/html5/class.ws.html5.links.php index 5870546c1..a75a56854 100644 --- a/inc/ws/Util/html5/class.ws.html5.links.php +++ b/inc/ws/Util/html5/class.ws.html5.links.php @@ -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