Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Commit 14c4870

Browse files
Remove now-unnecessary DOM selection utility
1 parent 695d360 commit 14c4870

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

library/src/html.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { extend } from 'lodash'
33
import 'whatwg-fetch'
44

55
import { Component, status, handMeDowns } from './core'
6-
import { domSelect } from './util/domSelect'
76
import { prepareNested } from './flow'
87

98
// html.Screens display HTML when run
@@ -56,9 +55,7 @@ export class Form extends Screen {
5655
})
5756

5857
// Capture form submissions
59-
this.options.events['submit form'] = (e) => {
60-
this.submit(e)
61-
}
58+
this.options.events['submit form'] = e => this.submit(e)
6259
}
6360

6461
submit(e=null) {
@@ -87,7 +84,7 @@ export class Form extends Screen {
8784

8885
serialize() {
8986
// Search for forms within the element
90-
const forms = domSelect('form', this.options.el)
87+
const forms = this.options.el.querySelectorAll('form')
9188

9289
// Prepare an empty output object
9390
const output = {}
@@ -160,7 +157,7 @@ export class Form extends Screen {
160157
// form's validator to the serialized data,
161158
// and also checking that the browser
162159
// validation succeeds.
163-
const forms = domSelect('form', this.options.el)
160+
const forms = this.options.el.querySelectorAll('form')
164161

165162
return this.options.validator(this.serialize()) &&
166163
Array.from(forms).every(form => form.checkValidity())

library/src/util/domSelect.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)