Skip to content

Commit

Permalink
Hide export buttons in fullscreen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
magicsunday committed Oct 24, 2024
1 parent 000867a commit f2cb74d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 28 deletions.
22 changes: 15 additions & 7 deletions resources/css/pedigree-chart.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
padding: 0;
}

.webtrees-pedigree-fullscreen-container .chart-button {
.webtrees-pedigree-fullscreen-container .btn-chart {
color: var(--bs-btn-bg);
background: rgb(245, 245, 245);
border: 1px solid rgb(210, 210, 210);
Expand All @@ -36,34 +36,42 @@
background: rgb(245, 245, 245);
}

.webtrees-pedigree-fullscreen-container .chart-button:hover {
.webtrees-pedigree-fullscreen-container .btn-chart:hover {
color: var(--link-color-hover);
}

.webtrees-pedigree-fullscreen-container .chart-button .icon {
.webtrees-pedigree-fullscreen-container .btn-chart .icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

.webtrees-pedigree-fullscreen-container .chart-button .icon .svg-inline--fa {
.webtrees-pedigree-fullscreen-container .btn-chart .icon .svg-inline--fa {
height: 1.5em;
vertical-align: -0.375em;
}

.webtrees-pedigree-fullscreen-container .fullscreen-button span:nth-child(2) {
.webtrees-pedigree-fullscreen-container .btn-fullscreen span:nth-child(2) {
display: none;
}

[fullscreen] .webtrees-pedigree-fullscreen-container .fullscreen-button span:nth-child(1) {
[fullscreen] .webtrees-pedigree-fullscreen-container .btn-fullscreen span:nth-child(1) {
display: none;
}

[fullscreen] .webtrees-pedigree-fullscreen-container .fullscreen-button span:nth-child(2) {
[fullscreen] .webtrees-pedigree-fullscreen-container .btn-fullscreen span:nth-child(2) {
display: inline-block;
}

[fullscreen] .webtrees-pedigree-fullscreen-container #exportPNG {
display: none;
}

[fullscreen] .webtrees-pedigree-fullscreen-container #exportSVG {
display: none;
}

/* Form */
.form-element-description {
-webkit-box-decoration-break: clone;
Expand Down
22 changes: 6 additions & 16 deletions resources/views/modules/components/buttonbar.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,12 @@ declare(strict_types=1);

<div class="btn-toolbar justify-content-end">
<div class="btn-group">
<div class="me-2">
<?= view($moduleName . '::modules/components/buttonbar/fullscreen-button') ?>
</div>
<div class="me-3">
<?= view($moduleName . '::modules/components/buttonbar/center-button') ?>
</div>
<div class="me-2">
<?= view($moduleName . '::modules/components/buttonbar/png-export-button') ?>
</div>
<div>
<?= view($moduleName . '::modules/components/buttonbar/svg-export-button') ?>
</div>
<?= view($moduleName . '::modules/components/buttonbar/fullscreen-button') ?>
<?= view($moduleName . '::modules/components/buttonbar/center-button') ?>
<?= view($moduleName . '::modules/components/buttonbar/png-export-button') ?>
<?= view($moduleName . '::modules/components/buttonbar/svg-export-button') ?>
<?php /*
<div>
<?= view($moduleName . '::modules/components/buttonbar/help-button') ?>
</div>
<?= view($moduleName . '::modules/components/buttonbar/help-button') ?>
*/ ?>
</div>
</div>
Expand All @@ -41,7 +31,7 @@ declare(strict_types=1);
// Hide fullscreen button if fullscreen mode is not available (e.g., iPhone)
if (!document.fullscreenEnabled) {
document
.querySelector(".webtrees-pedigree-fullscreen-container .fullscreen-button")
.querySelector(".webtrees-pedigree-fullscreen-container .btn-fullscreen")
.style
.display = 'none';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Fisharebest\Webtrees\I18N;

?>

<button class="btn-primary chart-button"
<button class="btn-primary btn-chart"
id="centerButton"
title="<?= I18N::translate('Re center') ?>"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Fisharebest\Webtrees\I18N;

?>

<button class="btn-primary chart-button fullscreen-button"
<button class="btn-primary btn-chart btn-fullscreen me-2"
data-wt-fullscreen=".webtrees-pedigree-fullscreen-container"
title="<?= I18N::translate('Switch between full screen mode and normal view') ?>"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Fisharebest\Webtrees\I18N;

?>

<button class="btn-primary chart-button"
<button class="btn-primary btn-chart"
title="<?= I18N::translate('Show help') ?>"
>
<span class="icon">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Fisharebest\Webtrees\I18N;

?>

<button class="btn-primary chart-button"
<button class="btn-primary btn-chart ms-3 me-2"
id="exportPNG"
title="<?= I18N::translate('Export as PNG') ?>"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Fisharebest\Webtrees\I18N;

?>

<button class="btn-primary chart-button"
<button class="btn-primary btn-chart"
id="exportSVG"
title="<?= I18N::translate('Export as SVG') ?>"
>
Expand Down

0 comments on commit f2cb74d

Please sign in to comment.