Skip to content

Commit e97169d

Browse files
committed
Move close button to top of toolbar
1 parent e9f64e1 commit e97169d

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

view/frontend/templates/component/debugger.phtml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@ $idConvertor = $viewModelFactory->create(IdConvertor::class);
2222
$htmlId = $idConvertor->toElementId($block->getNameInLayout());
2323
?>
2424
<div class="<?= $escaper->escapeHtml($css('')) ?>">
25-
<button class="fixed bottom-0 right-0 bg-orange-500 text-white p-4 z-20" @click="toggleVisibility">
26-
<span role="tab">
27-
<?= $escaper->escapeHtml(__('Loki Debugger')) ?>
28-
</span>
25+
<button x-show="invisible" class="fixed bottom-0 right-0 bg-orange-500 text-white p-4 z-20" @click="toggleVisibility">
26+
<?= $escaper->escapeHtml(__('Loki Debugger')) ?>
2927
</button>
3028

3129
<div x-show="visible" x-cloak class="<?= $escaper->escapeHtml($css('fixed bottom-0 left-0 right-0 h-64 md:block w-full border-t border-orange-500 bg-orange-50', 'tabs')) ?>" x-ref="toolbar">
3230
<div class="absolute top-0 left-0 right-0" style="height:10px; cursor: ns-resize" x-ref="resizer"></div>
3331

32+
<button class="absolute right-0 top-0 text-white p-4 z-20" @click="toggleVisibility">
33+
<?= $escaper->escapeHtml(__('Close')) ?>
34+
</button>
35+
3436
<div class="<?= $escaper->escapeHtml($css('flex items-stretch overflow-x-auto px-2 pt-2 bg-orange-500', 'td')) ?>" role="tablist">
3537
<?= /** @noEscape */ $childRenderer->all($block, 'loki-debugger.debugger.tab-button.') ?>
3638
</div>

view/frontend/templates/script/component/debugger-component.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ use Magento\Framework\View\Element\Template;
1313
currentTab: '',
1414
components: [],
1515
visible: true,
16+
invisible() {
17+
return !this.visible;
18+
},
1619
init() {
1720
this.visible = parseInt(LokiComponentsStorage.load('debugger.visible')) === 1;
1821
const toolbarHeight = parseInt(LokiComponentsStorage.load('debugger.height')) || 100;

0 commit comments

Comments
 (0)