From 405ad8b857ac7fda2aa7b85b2c9bcd017f646c4b Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 13 Dec 2017 10:37:47 +0000 Subject: [PATCH] #1490 --- .../html5/master/class.ws.html5.compiler.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 7f13073e7..abe416a08 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -423,9 +423,9 @@ class wsHTML5Compiler { * Duplicate paths are ignored. * @param $path */ - public function addJs($path,$collection=null) { + public function addJs($path, $collection = null) { - if(null===$collection) { + if (null === $collection) { // If JS is external, it will be included via the pluginJs collection // Otherwise, it will be compiled into the main JS file $collection = (preg_match('#^https?://#i', $path) === 1) ? 'pluginJs' : 'jsFiles'; @@ -1400,8 +1400,16 @@ class wsHTML5Compiler { $menuBreakpoint = empty($this->book->parametres->menuBreakpoint) ? '1080px' : $this->book->parametres->menuBreakpoint; $lessVariables['menu-breakpoint'] = $menuBreakpoint; - $lessVariables['menu-button-background'] = $this->theme->parametres->subSecondaryColor; $lessVariables['menu-background'] = $menuColor->toCSS(); + if ($this->theme->parametres->subSecondaryColor) { + $lessVariables['menu-button-background'] = wsHTML5::colorToCSS($this->theme->parametres->subSecondaryColor); + } else { + $lessVariables['menu-background-green'] = 'max(@max, min(255-45, green(@menu-background)))'; + $lessVariables['menu-background-red'] = 'max(@max, min(255-45, red(@menu-background)))'; + $lessVariables['menu-background-blue'] = 'max(@max, min(255-45, blue(@menu-background)))'; + $lessVariables['menu-button-background'] = 'overlay(rgb(@menu-background-red, @menu-background-green, @menu-background-blue), #c0c0c0)'; + } + $lessVariables['menu-text'] = $menuTextColor; $lessVariables['menu-field-background'] = wsHTML5::colorToCSS($this->theme->parametres->subFieldColor); $lessVariables['menu-field-text'] = wsHTML5::colorToCSS($this->theme->parametres->subTextFieldColor); @@ -1409,10 +1417,6 @@ class wsHTML5Compiler { $lessVariables['menu-select-text'] = wsHTML5::colorToCSS($this->theme->parametres->subTextSelectColor); $lessVariables['icon-color'] = wsHTML5::colorToCSS($this->theme->parametres->couleurI); - $menuMultiply = $menuColor->multiply($menuColor); - $menuMultiply2 = $menuMultiply->multiply($menuColor); - - // Archives if ($this->book->parametres->externalArchivesBack) { $this->vdir->copy($this->wdir . '/' . $this->book->parametres->externalArchivesBack, 'data/images/' . $this->book->parametres->externalArchivesBack); -- 2.39.5