use sinon filters rather than a layout hack

This commit is contained in:
carson 2020-05-22 11:48:18 -07:00
parent b96b9e3e32
commit 5806ce8852
2 changed files with 5 additions and 10 deletions

View File

@ -8,11 +8,6 @@
<script src="https://unpkg.com/prismjs@1.20.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="/js/htmx.js"></script>
<script>
htmx.logger = function(elt, event, data) {
if(console) {
//console.log(event, elt, data);
}
}
htmx.onLoad(function(){
Prism.highlightAll();
})
@ -23,11 +18,7 @@
<div class="c">
<div class="row">
<div class="2 col">
{% if page.url.indexOf("/examples/") == 0 %}
<span onclick="document.location = '/';" class="logo light">&lt;<a>/</a>&gt; htm<a>x</a></span>
{% else %}
<span hx-get="/" hx-target="body" hx-push-url="true" class="logo light">&lt;<a>/</a>&gt; htm<a>x</a></span>
{% endif %}
<span hx-get="/" hx-target="body" hx-push-url="true" class="logo light">&lt;<a>/</a>&gt; htm<a>x</a></span>
<svg onclick="document.getElementById('nav').classList.toggle('show')" class="hamburger" viewBox="0 0 100 80" width="25" height="25" style="margin-bottom:-5px">
<rect width="100" height="20" style="fill:rgb(52, 101, 164)" rx="10"></rect>
<rect y="30" width="100" height="20" style="fill:rgb(52, 101, 164)" rx="10"></rect>

View File

@ -8,6 +8,10 @@ server.getHTTPMethod = function(xhr) {
}
server.autoRespond = true;
server.autoRespondAfter = 300;
server.xhr.useFilters = true;
server.xhr.addFilter(function (method, url, async, username, password){
return url === "/";
})
//====================================
// Request Handling