| 207 | |
| 208 | |
| 209 | class Dialog { |
| 210 | constructor(id) { |
| 211 | this.$el = $(id); |
| 212 | this.$el.querySelectorAll('[close]').forEach(el => el.addEventListener('click', e => this.hide())) |
| 213 | this.$autoFocus = this.$el.querySelector('[autofocus]'); |
| 214 | } |
| 215 | |
| 216 | show() { |
| 217 | this.$el.setAttribute('show', 1); |
| 218 | if (this.$autoFocus) this.$autoFocus.focus(); |
| 219 | } |
| 220 | |
| 221 | hide() { |
| 222 | this.$el.removeAttribute('show'); |
| 223 | document.activeElement.blur(); |
| 224 | window.blur(); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | class ReceiveDialog extends Dialog { |
| 229 |
nothing calls this directly
no outgoing calls
no test coverage detected