@financial-times/n-conversion-forms 42.0.2 → 42.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.toolkitstate/ci.json
CHANGED
package/main.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/n-conversion-forms",
|
|
3
|
-
"version": "42.0.
|
|
3
|
+
"version": "42.0.4",
|
|
4
4
|
"description": "Containing jsx components and styles for forms included on Accounts and Acquisition apps (next-signup, next-profile, next-retention, etc).",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
package/utils/submit.js
CHANGED
|
@@ -7,22 +7,21 @@
|
|
|
7
7
|
* submit.updateText('Pay with Apple Pay');
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
const SUBMIT_BUTTON_CLASS = '.ncf__button--submit';
|
|
11
|
-
|
|
12
10
|
class Submit {
|
|
13
11
|
/**
|
|
14
12
|
* Initalise the submit utility
|
|
15
13
|
* @param {Element} element Usually the window.document
|
|
14
|
+
* @param id
|
|
16
15
|
* @throws If the document not passed
|
|
17
16
|
* @throws When the submit element not found
|
|
18
17
|
*/
|
|
19
|
-
constructor(element) {
|
|
18
|
+
constructor(element, id = 'submitButton') {
|
|
20
19
|
if (!element) {
|
|
21
20
|
throw new Error('Please supply a DOM element');
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
this.element = element;
|
|
25
|
-
this.$submit = element.querySelector(
|
|
24
|
+
this.$submit = element.querySelector(`#${id}`);
|
|
26
25
|
|
|
27
26
|
if (!this.$submit) {
|
|
28
27
|
throw new Error('Please include the submit button partial on the page');
|