mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
Updated data attributes script to read member name in form
no issue - We recently updated Ghost to allow theme developers to pass member's name via `data-members-name` attribute - The script covers the usecase for any themes using the attribute to fill member's name during the signup process
This commit is contained in:
parent
686ad537c7
commit
9263a84c09
1 changed files with 6 additions and 3 deletions
|
@ -11,8 +11,10 @@ function handleDataAttributes({siteUrl}) {
|
|||
errorEl.innerText = '';
|
||||
}
|
||||
form.classList.remove('success', 'invalid', 'error');
|
||||
let input = event.target.querySelector('input[data-members-email]');
|
||||
let email = input.value;
|
||||
let emailInput = event.target.querySelector('input[data-members-email]');
|
||||
let nameInput = event.target.querySelector('input[data-members-name]');
|
||||
let email = emailInput.value;
|
||||
let name = nameInput.value;
|
||||
let emailType = undefined;
|
||||
let labels = [];
|
||||
|
||||
|
@ -34,7 +36,8 @@ function handleDataAttributes({siteUrl}) {
|
|||
body: JSON.stringify({
|
||||
email: email,
|
||||
emailType: emailType,
|
||||
labels: labels
|
||||
labels: labels,
|
||||
name: name
|
||||
})
|
||||
}).then(function (res) {
|
||||
form.addEventListener('submit', submitHandler);
|
||||
|
|
Loading…
Add table
Reference in a new issue