Skip to content

Commit 56dd795

Browse files
save file
1 parent 18d381a commit 56dd795

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

html/chat-room/chat-room.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
let nn = 'chat-room-'+key;
176176
let ntab = tab.cloneNode(true);
177177
ntab.textContent = key;
178-
ntab.onclick = e=>console.log('click',key);
178+
ntab.onclick = e=>show(nn);
179179
tabs.append(ntab);
180180

181181
let node = $(host,nn);
@@ -199,7 +199,20 @@
199199
}//initdom
200200

201201

202-
function show(){
202+
function show(nn){
203+
204+
view.childNodes.forEach(node=>{
205+
206+
if(node.nodeType!==Node.ELEMENT_NODE)return;
207+
208+
var d = 'none';
209+
if(node.nodeName.toLowerCase()===nn){
210+
d = '';
211+
}
212+
node.style.display = d;
213+
214+
});
215+
203216
}//show
204217

205218

0 commit comments

Comments
 (0)