@saltcorn/mobile-app 1.0.0-beta.13 → 1.0.0-beta.15

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/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@saltcorn/mobile-app",
3
3
  "displayName": "Saltcorn mobile app",
4
- "version": "1.0.0-beta.13",
4
+ "version": "1.0.0-beta.15",
5
5
  "description": "Apache Cordova application with @saltcorn/markup",
6
6
  "main": "index.js",
7
7
  "scripts": {
8
8
  "add-platform": "cordova platform add",
9
9
  "add-plugin": "cordova plugin add",
10
- "build-app": "cordova build "
10
+ "build-app": "cordova build --verbose"
11
11
  },
12
12
  "author": "Christian Hugo",
13
13
  "license": "MIT",
@@ -88,10 +88,27 @@ function showAlerts(alerts, toast = true) {
88
88
  console.log(alerts);
89
89
  } else {
90
90
  const iframe = document.getElementById("content-iframe");
91
- const area = iframe.contentWindow.document.getElementById(
91
+ let area = iframe.contentWindow.document.getElementById(
92
92
  toast ? "toasts-area" : "top-alert"
93
93
  );
94
- if (!area) return false;
94
+ if (!area) {
95
+ const areaHtml = `<div class="container">
96
+ <div
97
+ id="toasts-area"
98
+ class="toast-container position-fixed bottom-0 start-50 p-0"
99
+ style="z-index: 999;"
100
+ aria-live="polite"
101
+ aria-atomic="true">
102
+ </div>
103
+ </div>`;
104
+ iframe.contentWindow.document
105
+ .getElementById("page-inner-content")
106
+ .insertAdjacentHTML("beforeend", areaHtml);
107
+ area = iframe.contentWindow.document.getElementById(
108
+ toast ? "toasts-area" : "top-alert"
109
+ );
110
+ }
111
+
95
112
  const successIds = [];
96
113
  area.innerHTML = "";
97
114
  for (const { type, msg } of alerts) {