MCPcopy Create free account
hub / github.com/SnapDrop/snapdrop / Dialog

Class Dialog

client/scripts/ui.js:209–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207
208
209class 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
228class ReceiveDialog extends Dialog {
229

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected