MDL-67074 forum: Add a new toast region when in full screen mode
authorAndrew Nicols <andrew@nicols.co.uk>
Tue, 5 Nov 2019 04:10:51 +0000 (12:10 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Tue, 5 Nov 2019 04:10:51 +0000 (12:10 +0800)
lib/amd/build/toast.min.js
lib/amd/build/toast.min.js.map
lib/amd/src/toast.js
mod/forum/amd/build/local/layout/fullscreen.min.js
mod/forum/amd/build/local/layout/fullscreen.min.js.map
mod/forum/amd/src/local/layout/fullscreen.js

index 0ec003f..25aacf0 100644 (file)
Binary files a/lib/amd/build/toast.min.js and b/lib/amd/build/toast.min.js differ
index ef6ab4a..c540fcc 100644 (file)
Binary files a/lib/amd/build/toast.min.js.map and b/lib/amd/build/toast.min.js.map differ
index 8fe5688..7128cc5 100644 (file)
@@ -78,10 +78,10 @@ export const add = async(message, configuration) => {
 };
 
 const getTargetNode = async() => {
-    const region = document.querySelector('.toast-wrapper');
+    const regions = document.querySelectorAll('.toast-wrapper');
 
-    if (region) {
-        return region;
+    if (regions.length) {
+        return regions[regions.length - 1];
     }
 
     await addToastRegion(document.body, 'fixed-bottom');
index 14669a0..e7df086 100644 (file)
Binary files a/mod/forum/amd/build/local/layout/fullscreen.min.js and b/mod/forum/amd/build/local/layout/fullscreen.min.js differ
index 83ad24c..3b53242 100644 (file)
Binary files a/mod/forum/amd/build/local/layout/fullscreen.min.js.map and b/mod/forum/amd/build/local/layout/fullscreen.min.js.map differ
index 2aaf122..512ecae 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 import {addIconToContainer} from 'core/loadingicon';
+import {addToastRegion} from 'core/toast';
 
 /**
  * @param {string} templateName
@@ -36,6 +37,7 @@ const getComposedLayout = ({
     container.classList.add('layout');
     container.classList.add('fullscreen');
     container.setAttribute('aria-role', 'application');
+    addToastRegion(container);
 
     // Lock scrolling on the document body.
     lockBodyScroll();