mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
WebHost: fix host room not updating (ports in) slot table (#4308)
This commit is contained in:
@@ -178,8 +178,15 @@
|
|||||||
})
|
})
|
||||||
.then(text => new DOMParser().parseFromString(text, 'text/html'))
|
.then(text => new DOMParser().parseFromString(text, 'text/html'))
|
||||||
.then(newDocument => {
|
.then(newDocument => {
|
||||||
let el = newDocument.getElementById("host-room-info");
|
["host-room-info", "slots-table"].forEach(function(id) {
|
||||||
document.getElementById("host-room-info").innerHTML = el.innerHTML;
|
const newEl = newDocument.getElementById(id);
|
||||||
|
const oldEl = document.getElementById(id);
|
||||||
|
if (oldEl && newEl) {
|
||||||
|
oldEl.innerHTML = newEl.innerHTML;
|
||||||
|
} else if (newEl) {
|
||||||
|
console.warn(`Did not find element to replace for ${id}`)
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
{% macro list_patches_room(room) %}
|
{% macro list_patches_room(room) %}
|
||||||
{% if room.seed.slots %}
|
{% if room.seed.slots %}
|
||||||
<table>
|
<table id="slots-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Id</th>
|
<th>Id</th>
|
||||||
|
Reference in New Issue
Block a user