Skip to content

Commit

Permalink
feat: make z-index of topbar configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jan 24, 2023
1 parent a386ec6 commit 81ef91f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
12 changes: 11 additions & 1 deletion RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static function getModuleInfo()
{
return [
'title' => 'RockFrontend',
'version' => '2.16.2',
'version' => '2.17.0',
'summary' => 'Module for easy frontend development',
'autoload' => true,
'singular' => true,
Expand Down Expand Up @@ -357,6 +357,7 @@ public function addTopBar(&$html)

$topbar = $this->wire->files->render(__DIR__ . "/bar/topbar.php", [
'logourl' => $this->toUrl(__DIR__ . "/RockFrontend.svg", true),
'z' => is_int($this->topbarz) ? $this->topbarz : 999,
]);
$html = str_replace("</body", "$topbar</body", $html);
}
Expand Down Expand Up @@ -1902,6 +1903,15 @@ private function configSettings($inputfields)
$f->value = (array)$this->features;
$fs->add($f);

$f = new InputfieldInteger();
$f->name = 'topbarz';
$f->label = 'Topbar Z-Index';
$f->initValue = 999;
$f->value = $this->topbarz;
$f->showIf = 'features=topbar';
$f->notes = 'Default is 999';
$fs->add($f);

$f = $this->wire->modules->get('InputfieldCheckboxes');
$f->name = 'migrations';
$f->label = "Migrations";
Expand Down
1 change: 0 additions & 1 deletion bar/bar.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ body.overflow-hidden {
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
padding: 5px;
border-radius: 0 0 5px 0;
z-index: 99;

#rpb-logo {
height: 20px;
Expand Down
1 change: 0 additions & 1 deletion bar/bar.less.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ body.overflow-hidden {
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
padding: 5px;
border-radius: 0 0 5px 0;
z-index: 99;
}
#rpb-topbar #rpb-logo {
height: 20px;
Expand Down
2 changes: 1 addition & 1 deletion bar/topbar.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="rpb-topbar">
<div id="rpb-topbar" style="z-index: <?= $z ?>">
<a href="https://www.baumrock.com" target=_blank>
<img id="rpb-logo" src="<?= $logourl ?>">
</a>
Expand Down

0 comments on commit 81ef91f

Please sign in to comment.