Skip to content
Snippets Groups Projects
Commit d0c34d5e authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Sidebar on left fix.

parent 9440ee0f
Branches
Tags
No related merge requests found
...@@ -53,10 +53,10 @@ class LayoutClass extends \VuFind\View\Helper\AbstractLayoutClass ...@@ -53,10 +53,10 @@ class LayoutClass extends \VuFind\View\Helper\AbstractLayoutClass
{ {
switch ($class) { switch ($class) {
case 'mainbody': case 'mainbody':
return $this->left ? 'col-md-9 col-md-pull-3' : 'col-md-9'; return $this->left ? 'col-md-9 col-md-push-3' : 'col-md-9';
case 'sidebar': case 'sidebar':
return $this->left return $this->left
? 'sidebar col-md-3 col-md-push-9 hidden-print' ? 'sidebar col-md-3 col-md-pull-9 hidden-print'
: 'sidebar col-md-3 hidden-print'; : 'sidebar col-md-3 hidden-print';
} }
} }
......
...@@ -341,7 +341,7 @@ class Initializer ...@@ -341,7 +341,7 @@ class Initializer
$resources->addLessCss($currentThemeInfo['less']); $resources->addLessCss($currentThemeInfo['less']);
} }
if (isset($currentThemeInfo['scss'])) { if (isset($currentThemeInfo['scss'])) {
$resources->addSassCss($currentThemeInfo['scss']); $resources->addScssCss($currentThemeInfo['scss']);
} }
if (isset($currentThemeInfo['css'])) { if (isset($currentThemeInfo['css'])) {
$resources->addCss($currentThemeInfo['css']); $resources->addCss($currentThemeInfo['css']);
......
...@@ -44,13 +44,25 @@ class ResourceContainer ...@@ -44,13 +44,25 @@ class ResourceContainer
* @var array * @var array
*/ */
protected $less = array(); protected $less = array();
/** /**
* Sass CSS files * Less CSS active boolean
* *
* @var array * @var array
*/ */
protected $sass = array(); protected $lessActive = false;
/**
* scss CSS files
*
* @var array
*/
protected $scss = array();
/**
* SCSS CSS active boolean
*
* @var array
*/
protected $scssActive = false;
/** /**
* CSS files * CSS files
...@@ -99,25 +111,35 @@ class ResourceContainer ...@@ -99,25 +111,35 @@ class ResourceContainer
if (!is_array($less) && !is_a($less, 'Traversable')) { if (!is_array($less) && !is_a($less, 'Traversable')) {
$less = array($less); $less = array($less);
} }
foreach ($less as $current) { $this->lessActive = !isset($less['active']) || $less['active'] === true;
$this->less[] = $current; if ($this->lessActive) {
unset($less['active']);
foreach ($less as $index=>$current) {
$this->less[$index] = $current;
$this->removeCSS($current);
}
} }
} }
/** /**
* Add a Sass CSS file. * Add a scss CSS file.
* *
* @param array|string $sass Sass CSS file (or array of Sass CSS files) to add * @param array|string $scss scss CSS file (or array of scss CSS files) to add
* *
* @return void * @return void
*/ */
public function addSassCss($sass) public function addScssCss($scss)
{ {
if (!is_array($sass) && !is_a($sass, 'Traversable')) { if (!is_array($scss) && !is_a($scss, 'Traversable')) {
$sass = array($sass); $scss = array($scss);
} }
foreach ($sass as $current) { $this->scssActive = !isset($scss['active']) || $scss['active'] === true;
$this->sass[] = $current; if ($this->scssActive) {
unset($scss['active']);
foreach ($scss as $index=>$current) {
$this->scss[$index] = $current;
$this->removeCSS($current);
}
} }
} }
...@@ -135,7 +157,9 @@ class ResourceContainer ...@@ -135,7 +157,9 @@ class ResourceContainer
$css = array($css); $css = array($css);
} }
foreach ($css as $current) { foreach ($css as $current) {
$this->css[] = $current; if (!$this->activeInLess($current) && !$this->activeInScss($current)) {
$this->css[] = $current;
}
} }
} }
...@@ -167,13 +191,13 @@ class ResourceContainer ...@@ -167,13 +191,13 @@ class ResourceContainer
return array_unique($this->less); return array_unique($this->less);
} }
/** /**
* Get Sass CSS files. * Get SCSS CSS files.
* *
* @return array * @return array
*/ */
public function getSassCss() public function getScssCss()
{ {
return array_unique($this->sass); return array_unique($this->scss);
} }
/** /**
...@@ -261,4 +285,46 @@ class ResourceContainer ...@@ -261,4 +285,46 @@ class ResourceContainer
{ {
return $this->generator; return $this->generator;
} }
/**
* Check if a CSS file is being dynamically compiled in LESS
*
* @return boolean
*/
private function activeInLess($file)
{
if (empty($this->less) || $this->lessActive === false) {
return false;
}
list($lessFile,) = explode('.', $file);
$lessFile .= '.less';
return in_array($lessFile, $this->less, true) ? true : false;
}
/**
* Check if a CSS file is being dynamically compiled in SCSS
*
* @return boolean
*/
private function activeInScss($file)
{
if (empty($this->scss) || $this->scssActive === false) {
return false;
}
list($scssFile,) = explode('.', $file);
$scssFile .= '.scss';
return in_array($scssFile, $this->scss, true) ? true : false;
}
/**
* Check if a CSS file is being dynamically compiled in SCSS
*
* @return boolean
*/
private function removeCSS($file)
{
list($name, ) = explode('.', $file);
$name .= '.css';
unset($this->css[array_search($name, $this->css)]);
}
} }
...@@ -87,7 +87,7 @@ class HeadThemeResources extends \Zend\View\Helper\AbstractHelper ...@@ -87,7 +87,7 @@ class HeadThemeResources extends \Zend\View\Helper\AbstractHelper
isset($parts[2]) ? trim($parts[2]) : false isset($parts[2]) ? trim($parts[2]) : false
); );
} }
// Compile and load LESS (make sure we prepend them in the appropriate order // Compile and load LESS (make sure we prepend them in the appropriate order
// theme resources should load before extras added by individual templates): // theme resources should load before extras added by individual templates):
foreach (array_reverse($this->container->getLessCss()) as $current) { foreach (array_reverse($this->container->getLessCss()) as $current) {
...@@ -96,8 +96,8 @@ class HeadThemeResources extends \Zend\View\Helper\AbstractHelper ...@@ -96,8 +96,8 @@ class HeadThemeResources extends \Zend\View\Helper\AbstractHelper
// Compile and load SASS (make sure we prepend them in the appropriate order // Compile and load SASS (make sure we prepend them in the appropriate order
// theme resources should load before extras added by individual templates): // theme resources should load before extras added by individual templates):
foreach (array_reverse($this->container->getSassCss()) as $current) { foreach (array_reverse($this->container->getScssCss()) as $current) {
$headLink()->addSassStylesheet($current); $headLink()->addScssStylesheet($current);
} }
// Load Javascript (same ordering considerations as CSS, above): // Load Javascript (same ordering considerations as CSS, above):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
.fa-x {background-image:url('../../images/icons/page_white.png'); &:extend(.bp-icon);} .fa-x {background-image:url('../../images/icons/page_white.png'); &:extend(.bp-icon);}
i.fa-archive {background-image:url('../../images/icons/package.png'); &:extend(.bp-icon);} i.fa-archive {background-image:url('../../images/icons/package.png'); &:extend(.bp-icon);}
i.fa-asterisk {background-image:url('../../images/icons/list.png'); &:extend(.bp-icon);} i.fa-asterisk {background-image:url('../../images/icons/list.png'); &:extend(.bp-icon);}
i.fa-atlas {background-image:url('../../images/icons/map.png'); &:extend(.bp-icon);} i.fa-atlas {background-image:url('../../images/icons/map.png'); &:extend(.bp-icon);}
i.fa-bell {background-image:url('../../images/icons/bell.png'); &:extend(.bp-icon);} i.fa-bell {background-image:url('../../images/icons/bell.png'); &:extend(.bp-icon);}
i.fa-book {background-image:url('../../images/icons/book.png'); &:extend(.bp-icon);} i.fa-book {background-image:url('../../images/icons/book.png'); &:extend(.bp-icon);}
i.fa-bookbag-add {background-image:url('../../images/icons/bookbag_add.png'); &:extend(.bp-icon);} i.fa-bookbag-add {background-image:url('../../images/icons/bookbag_add.png'); &:extend(.bp-icon);}
......
...@@ -138,6 +138,11 @@ label.list-group-item {border-radius:0;font-weight:normal;margin-top:0;padding-l ...@@ -138,6 +138,11 @@ label.list-group-item {border-radius:0;font-weight:normal;margin-top:0;padding-l
} }
} }
} }
.list-group-item.active, .badge {
i.fa {
cursor:inherit;
}
}
/* --- Slider accessibility --- */ /* --- Slider accessibility --- */
.slider { .slider {
......
...@@ -20,10 +20,12 @@ return array( ...@@ -20,10 +20,12 @@ return array(
'lightbox.js', 'lightbox.js',
), ),
'less' => array( 'less' => array(
//'compiled.less' 'active' => true,
'compiled.less'
), ),
'scss' => array( 'scss' => array(
//'compiled.scss' 'active' => false,
'compiled.scss'
), ),
'favicon' => 'vufind-favicon.ico', 'favicon' => 'vufind-favicon.ico',
'helpers' => array( 'helpers' => array(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment