]> _ Git - cubeextranet.git/commitdiff
#1472
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 19 Jun 2017 12:02:13 +0000 (12:02 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 19 Jun 2017 12:02:13 +0000 (12:02 +0000)
inc/ws/Util/html5/slider/class.ws.html5.compiler.php

index 78e9bfa9b14510f735ae2895243721057f87eed8..285db98a47444516d81055ce08f219f22137b2af 100644 (file)
@@ -1175,11 +1175,15 @@ class wsHTML5Compiler {
                return true;
        }
 
+       protected function _lessBoolean($val) {
+               return $val ? 'true' : 'false';
+       }
+
        protected function writeCSS($file, $links) {
                $res = array();
 
                $lessVariables = array();
-               $lessVariables['slider-display'] = $this->theme->parametres->pagesBar ? 'true' : 'false';
+               $lessVariables['slider-display'] = $this->_lessBoolean($this->theme->parametres->pagesBar);
                $lessVariables['slider-thumb-background'] = wsHTML5::colorToCSS($this->theme->parametres->pageBarThumbBack);
 
                // General theme
@@ -1201,7 +1205,8 @@ class wsHTML5Compiler {
                $leftOfRightPage = (floor($cssWidth) - 1) . 'px';
 
                $lessVariables['z'] = $this->z;
-
+               $lessVariables['book-page-width'] = $w;
+               $lessVariables['book-page-height'] = $h;
 
                $res[] = '.portrait #pages,.portrait .doublePage.page,.page,.doublePage._3d,#shadow>div{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}';
                $res[] = '.doublePage,#pages,#links{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}';
@@ -1216,12 +1221,10 @@ class wsHTML5Compiler {
                $res[] = '#links.right{left:-' . $w . ';}';
                $res[] = '.landscape #shadow>div.right{left: ' . $w . ';}';
                $res[] = '.landscape .page.right{left:' . $w . '}';
-               if ($this->theme->parametres->displayPageNumber) {
-                       $res[] = '#pagesnumbers{font-size: ' . (11 * $this->z) . 'px;margin: ' . (5 * $this->z) . 'px 0 0 0;top:' . $h . ';color:' . wsHTML5::colorToCSS($this->theme->parametres->colorPageNumber) . '}';
-                       $res[] = '#pagesnumbers div{width:' . $w . '}';
-               } else {
-                       $res[] = '#pagesnumbers{display:none;}';
-               }
+
+               $lessVariables['page-number-color'] = wsHTML5::colorToCSS($this->theme->parametres->colorPageNumber);
+               $lessVariables['display-page-number'] = $this->_lessBoolean($this->theme->parametres->displayPageNumber);
+
                $res[] = '.doublePage._2d,.doublePage._3d{' . wsHTML5::writeCSSUA('transition', 'all ' . $this->book->parametres->mobileTransitionDuration . 's ease-in-out') . '}';
 
                $res[] = '.background{' . wsHTML5::writeCSSUA('transform-origin', 'top left') . ';}';