@financial-times/n-myft-ui 40.0.1 → 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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "branch": "",
3
3
  "repo": "n-myft-ui",
4
- "version": "9e66c3e0ad6f6b3a51b8f49477fc73a864ffccc7",
5
- "tag": "v40.0.1"
4
+ "version": "da6a59658803a3898eb4a2d02f16561dded775aa",
5
+ "tag": "v40.0.2"
6
6
  }
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 () {
@@ -513,7 +514,8 @@ function initialEventListeners () {
513
514
  return openCreateListAndAddArticleOverlay(contentId);
514
515
  }
515
516
  const configKeys = configSet.dataset.myftUiSaveConfig.split(',');
516
- const config = configKeys.reduce((configObj, key) => (key ? { ...configObj, [key]: true} : configObj), {});
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.1",
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.1",
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",