@financial-times/n-myft-ui 28.3.2 → 28.3.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@
|
|
20
20
|
{{#if isSaved}}
|
21
21
|
{{!-- The value of alternate label needs to be the opposite of label / the current saved state. This allows the client side JS to toggle the labels on state changes --}}
|
22
22
|
title="{{#if title}}{{title}} is{{/if}} Saved to myFT"
|
23
|
-
aria-label="{{#if title}}{{title}} is{{/if}} Saved to myFT"
|
23
|
+
aria-label="{{#if title}}{{title}} is{{/if}} Saved to myFT - Unsave"
|
24
24
|
data-alternate-label="{{#if title}}Save {{title}} to myFT for later{{else}}Save this article to myFT for later{{/if}}"
|
25
25
|
aria-pressed="true"
|
26
26
|
{{else}}
|
@@ -116,7 +116,6 @@ export default async function openSaveArticleToListVariant (contentId, options =
|
|
116
116
|
const overlayContent = document.querySelector('.o-overlay__content');
|
117
117
|
removeDescription();
|
118
118
|
overlayContent.insertAdjacentElement('beforeend', formElement);
|
119
|
-
formElement.elements[0].focus();
|
120
119
|
}
|
121
120
|
|
122
121
|
createListOverlay.open();
|
@@ -168,7 +167,8 @@ function FormElement (createList, showPublicToggle, attachDescription, onListCre
|
|
168
167
|
<form class="myft-ui-create-list-variant-form">
|
169
168
|
<label class="myft-ui-create-list-variant-form-name o-forms-field">
|
170
169
|
<span class="o-forms-input o-forms-input--text">
|
171
|
-
<input class="myft-ui-create-list-variant-text" type="text" name="list-name"
|
170
|
+
<input class="myft-ui-create-list-variant-text" type="text" name="list-name">
|
171
|
+
List name
|
172
172
|
</span>
|
173
173
|
</label>
|
174
174
|
|
@@ -258,7 +258,7 @@ function ContentElement (hasDescription, onClick) {
|
|
258
258
|
|
259
259
|
const content = `
|
260
260
|
<div class="myft-ui-create-list-variant-footer">
|
261
|
-
<button class="myft-ui-create-list-variant-add myft-ui-create-list-variant-add-collapsed" data-trackable="add-to-new-list" text="add to new list">Add to a new list</button>
|
261
|
+
<button class="myft-ui-create-list-variant-add myft-ui-create-list-variant-add-collapsed" aria-expanded=false data-trackable="add-to-new-list" text="add to new list">Add to a new list</button>
|
262
262
|
${hasDescription ? `
|
263
263
|
${description}
|
264
264
|
` : ''}
|
@@ -284,11 +284,13 @@ function ContentElement (hasDescription, onClick) {
|
|
284
284
|
|
285
285
|
function restoreFormHandler () {
|
286
286
|
contentElement.querySelector('.myft-ui-create-list-variant-add').classList.add('myft-ui-create-list-variant-add-collapsed');
|
287
|
+
contentElement.querySelector('.myft-ui-create-list-variant-add').setAttribute('aria-expanded', false);
|
287
288
|
return contentElement.addEventListener('click', clickHandler, { once: true });
|
288
289
|
}
|
289
290
|
|
290
291
|
function clickHandler (event) {
|
291
292
|
contentElement.querySelector('.myft-ui-create-list-variant-add').classList.remove('myft-ui-create-list-variant-add-collapsed');
|
293
|
+
contentElement.querySelector('.myft-ui-create-list-variant-add').setAttribute('aria-expanded', true);
|
292
294
|
onClick(event);
|
293
295
|
}
|
294
296
|
|