Skip to content

Commit 4e5d5af

Browse files
save file
1 parent 6fe9552 commit 4e5d5af

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

html/chat-room-tmp/chat-room-tmp.html

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110

111111
<div id=btns>
112112
<input value=send type=button title=ctrl+enter>
113-
<input value=abort type=button>
113+
<input value=pause type=button>
114114
</div>
115115

116116
</section>
@@ -143,6 +143,8 @@
143143

144144
var target;
145145

146+
var ui = {};
147+
146148

147149
var rd = {};
148150
rd.attr = {};
@@ -205,26 +207,27 @@
205207

206208
obj.initdom = async function(){
207209

208-
shadow = host.shadowRoot;
210+
shadow = host.shadowRoot;
209211

210212

211-
view = $(shadow,'#view');
213+
view = $(shadow,'#view');
212214

213-
msg = $(view,'.msg');
215+
msg = $(view,'.msg');
214216
msg.remove();
215217

216-
view.style.display = '';
218+
view.style.display = '';
217219

218220

219-
var info = $(shadow,'#info');
221+
var info = $(shadow,'#info');
220222

221223
$.chkbox(info,'#show-password',btn.password);
222224

223-
$(shadow,'#txt').onkeydown = kd.user;
225+
$(shadow,'#txt').onkeydown = kd.user;
224226
$(shadow,'#txt').focus();
225227

226-
$(shadow,'[value=send]').onclick = btn.send;
227-
$(shadow,'[value=abort]').onclick = ()=>poll.abort=true;
228+
$(shadow,'[value=send]').onclick = btn.send;
229+
ui.pause = $(shadow,'[value=abort]');
230+
ui.pause.onclick = btn.pause;
228231

229232

230233
post.start();
@@ -269,6 +272,19 @@
269272

270273
}//send
271274

275+
btn.pause = function(){
276+
277+
if(poll.abort){
278+
ui.pause.value = 'pause';
279+
poll.abort = false;
280+
poll.update.initial();
281+
}else{
282+
ui.pause.value = 'resume';
283+
poll.abort = true;
284+
}
285+
286+
}//pause
287+
272288

273289
//:
274290

0 commit comments

Comments
 (0)