fix: 修复右侧列表切换Tab时由于表情包被移除导致的JS报错
This commit is contained in:
@@ -68,17 +68,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{-- 酷库面板 --}}
|
|
||||||
<div class="user-list-content" id="panel-action" style="display: none; padding: 6px;">
|
|
||||||
<div style="font-size: 11px; color: #666; line-height: 2;">
|
|
||||||
@foreach (['微笑', '大笑', '愤怒', '哭泣', '害羞', '鄙视', '得意', '疑惑', '同情', '无奈', '拳打', '飞吻', '偷看', '战战兢兢'] as $act)
|
|
||||||
<a href="#" onclick="setAction('{{ $act }}'); return false;"
|
|
||||||
style="display: inline-block; padding: 2px 6px; background: #f0f6ff; border: 1px solid #dde8ff; border-radius: 3px; margin: 1px; color: #336699; font-size: 11px;">{{ $act }}</a>
|
|
||||||
@endforeach
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- 底部在线统计 --}}
|
{{-- 底部在线统计 --}}
|
||||||
<div class="online-stats">
|
<div class="online-stats">
|
||||||
在线: <strong id="online-count-footer">0</strong> 人
|
在线: <strong id="online-count-footer">0</strong> 人
|
||||||
|
|||||||
@@ -43,18 +43,11 @@
|
|||||||
|
|
||||||
// ── Tab 切换 ──────────────────────────────────────
|
// ── Tab 切换 ──────────────────────────────────────
|
||||||
function switchTab(tab) {
|
function switchTab(tab) {
|
||||||
// 切换名单/房间/贴图/酷库 面板
|
// 切换名单/房间/酷库 面板
|
||||||
['users', 'rooms', 'emoji', 'action'].forEach(t => {
|
['users', 'rooms', 'action'].forEach(t => {
|
||||||
document.getElementById('panel-' + t).style.display = t === tab ? 'block' : 'none';
|
document.getElementById('panel-' + t).style.display = t === tab ? 'block' : 'none';
|
||||||
document.getElementById('tab-' + t)?.classList.toggle('active', t === tab);
|
document.getElementById('tab-' + t)?.classList.toggle('active', t === tab);
|
||||||
});
|
});
|
||||||
// 贴图 Tab 懒加载
|
|
||||||
if (tab === 'emoji') {
|
|
||||||
document.querySelectorAll('#panel-emoji img[data-src]').forEach(img => {
|
|
||||||
img.src = img.dataset.src;
|
|
||||||
img.removeAttribute('data-src');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 房间 Tab:拉取在线人数列表
|
// 房间 Tab:拉取在线人数列表
|
||||||
if (tab === 'rooms') {
|
if (tab === 'rooms') {
|
||||||
loadRoomsOnlineStatus();
|
loadRoomsOnlineStatus();
|
||||||
|
|||||||
Reference in New Issue
Block a user