Skip to content

Commit 4f1168e

Browse files
committed
Only execute the js if the extension is enabled.
1 parent 9b69bf8 commit 4f1168e

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

view/frontend/layout/default.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?xml version="1.0"?>
22
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
3-
<head>
4-
<script src="JustinKase_LayoutHints::js/jk-hints.js"/>
5-
</head>
63
<body>
74
<referenceContainer name="root">
85
<block name="justinkase_layout_info" as="jkase_info" class="JustinKase\LayoutHints\Block\Info" template="JustinKase_LayoutHints::info.phtml" ifconfig="justinkase_hints/global_setting/status" after="-"/>

view/frontend/templates/info.phtml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,13 @@
1414
<h4>Suggested Available Containers</h4>
1515
<pre><?php var_export($block->getLayout()->getUpdate()->getContainers());?></pre>
1616
</div>
17+
<script>
18+
(function(){
19+
document.addEventListener('keydown', function (e) {
20+
if (e.key === 'H' && e.shiftKey && e.ctrlKey) {
21+
document.getElementsByTagName('body')[0].classList.toggle('justinkase-hints-enabled');
22+
}
23+
})
24+
}());
25+
</script>
1726
<?php endif; ?>

view/frontend/web/js/jk-hints.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)