@financial-times/n-myft-ui 40.0.0 → 40.0.2
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
@@ -28,9 +28,9 @@ function toggleButton (buttonEl, state) {
|
|
28
28
|
nextButtons.toggleState(buttonEl);
|
29
29
|
const name = buttonEl.getAttribute('data-name');
|
30
30
|
if (isPressed) {
|
31
|
-
buttonEl.setAttribute('aria-label', '
|
31
|
+
buttonEl.setAttribute('aria-label', 'Instant alerts for ' + name + ' currently disabled, change to enable');
|
32
32
|
} else {
|
33
|
-
buttonEl.setAttribute('aria-label', '
|
33
|
+
buttonEl.setAttribute('aria-label', 'Instant alerts for ' + name + ' currently enabled, change to disable');
|
34
34
|
}
|
35
35
|
}
|
36
36
|
|
@@ -14,10 +14,10 @@
|
|
14
14
|
{{/if}}
|
15
15
|
<button
|
16
16
|
{{#ifAll hasInstantAlert @root.cacheablePersonalisedUrl}}
|
17
|
-
aria-label="
|
17
|
+
aria-label="Instant alerts for {{name}} currently enabled, change to disable"
|
18
18
|
aria-pressed="true"
|
19
19
|
{{else}}
|
20
|
-
aria-label="
|
20
|
+
aria-label="Instant alerts for {{name}} currently disabled, change to enable"
|
21
21
|
aria-pressed="false"
|
22
22
|
{{/ifAll}}
|
23
23
|
class="o3-button n-myft-ui__button--instant"
|
package/myft/ui/lists.js
CHANGED
@@ -12,7 +12,7 @@ let haveLoadedLists = false;
|
|
12
12
|
let createListOverlay;
|
13
13
|
|
14
14
|
async function openSaveArticleToList (contentId, options = {}) {
|
15
|
-
const { name, nonModal = false } = options;
|
15
|
+
const { name, nonModal = false, triggerElement } = options;
|
16
16
|
const modal = !nonModal;
|
17
17
|
function createList (newList, cb) {
|
18
18
|
if(!newList || !newList.name) {
|
@@ -85,6 +85,7 @@ async function openSaveArticleToList (contentId, options = {}) {
|
|
85
85
|
heading: { title: headingElement.outerHTML },
|
86
86
|
parentnode: isMobile() ? '.o-share--horizontal' : '.o-share--vertical',
|
87
87
|
class: 'myft-ui-create-list',
|
88
|
+
trigger: triggerElement,
|
88
89
|
});
|
89
90
|
|
90
91
|
function addCloseButtonDataTrackable () {
|
@@ -318,8 +319,8 @@ function ListsElement (lists, addToList, removeFromList) {
|
|
318
319
|
const listCheckboxElement = ListCheckboxElement(addToList, removeFromList);
|
319
320
|
|
320
321
|
const listsTemplate = `
|
321
|
-
<div class="myft-ui-create-list-lists o-forms-field o-forms-field--optional" role="group">
|
322
|
-
<span class="myft-ui-create-list-lists-text">Add to list</span>
|
322
|
+
<div class="myft-ui-create-list-lists o-forms-field o-forms-field--optional" role="group" aria-labelledby="add-to-list-label">
|
323
|
+
<span id="add-to-list-label" class="myft-ui-create-list-lists-text">Add to list</span>
|
323
324
|
<span class="myft-ui-create-list-lists-container o-forms-input o-forms-input--checkbox">
|
324
325
|
</span>
|
325
326
|
</div>
|
@@ -513,7 +514,8 @@ function initialEventListeners () {
|
|
513
514
|
return openCreateListAndAddArticleOverlay(contentId);
|
514
515
|
}
|
515
516
|
const configKeys = configSet.dataset.myftUiSaveConfig.split(',');
|
516
|
-
const
|
517
|
+
const triggerElement = configSet.querySelector('button[type="submit"]');
|
518
|
+
const config = configKeys.reduce((configObj, key) => (key ? { ...configObj, [key]: true} : configObj), { triggerElement });
|
517
519
|
return openCreateListAndAddArticleOverlay(contentId, config);
|
518
520
|
});
|
519
521
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@financial-times/n-myft-ui",
|
3
|
-
"version": "40.0.
|
3
|
+
"version": "40.0.2",
|
4
4
|
"description": "Client side component for interaction with myft",
|
5
5
|
"main": "server.js",
|
6
6
|
"scripts": {
|
@@ -108,7 +108,7 @@
|
|
108
108
|
"@financial-times/n-notification": "^9.0.0",
|
109
109
|
"@financial-times/o-forms": "^10.0.1",
|
110
110
|
"@financial-times/o-grid": "^6.1.8",
|
111
|
-
"@financial-times/o-overlay": "^5.0.
|
111
|
+
"@financial-times/o-overlay": "^5.0.2",
|
112
112
|
"@financial-times/o-tooltip": "^6.0.0",
|
113
113
|
"@financial-times/o3-button": "^3.0.0",
|
114
114
|
"@financial-times/o3-editorial-typography": "^3.0.2",
|