show placholder instead of no explore box at all
This commit is contained in:
parent
daced4ec04
commit
41db9bf07d
2 changed files with 10 additions and 2 deletions
|
|
@ -38,12 +38,15 @@ if (btnModal) {
|
||||||
// If #usb-butter exists and a request to thishost.tld/usb-butter returns status 200
|
// If #usb-butter exists and a request to thishost.tld/usb-butter returns status 200
|
||||||
// change display of #usb-butter to inherit
|
// change display of #usb-butter to inherit
|
||||||
const usbButter = document.querySelector('#usb-butter');
|
const usbButter = document.querySelector('#usb-butter');
|
||||||
if (usbButter) {
|
const usbButterPlaceholder = document.querySelector('#usb-butter-placeholder');
|
||||||
|
if (usbButter && usbButterPlaceholder) {
|
||||||
fetch(usbButter.dataset.url)
|
fetch(usbButter.dataset.url)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
usbButter.style.display = 'inherit';
|
usbButter.style.display = 'inherit';
|
||||||
|
usbButterPlaceholder.style.display = 'none';
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -13,6 +13,11 @@ layout: default
|
||||||
{% t explore %}
|
{% t explore %}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
<div id="usb-butter-placeholder">
|
||||||
|
<div class="card">
|
||||||
|
{% t explore_missing %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<a href="/chat/#/room/%23public%3A{{site.data.deployment.chat_server}}">
|
<a href="/chat/#/room/%23public%3A{{site.data.deployment.chat_server}}">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img src="{{ site.baseurl }}/assets/images/message-icon.png" alt="Message Icon" class="card-icon">
|
<img src="{{ site.baseurl }}/assets/images/message-icon.png" alt="Message Icon" class="card-icon">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue