|
3 | 3 | */ |
4 | 4 | (() => { |
5 | 5 | if (window !== window.top) return; |
6 | | - const version = buildVersion(1, 10, 1); |
| 6 | + const version = buildVersion(1, 10, 2); |
7 | 7 | if (window.SimpleToast) { |
8 | 8 | if (SimpleToast.version) { |
9 | 9 | if (SimpleToast.version >= version.number) return; |
|
139 | 139 | if (!text) return blankToast; |
140 | 140 | const id = count++; |
141 | 141 | const el = document.createElement('div'); |
| 142 | + const tel = el.appendChild(document.createElement('span')); |
| 143 | + const body = el.appendChild(document.createElement('span')); |
| 144 | + const fel = el.appendChild(document.createElement('span')); |
142 | 145 | if (className) { |
143 | 146 | const clazz = className.toast || className; |
144 | 147 | el.className = Array.isArray(clazz) ? clazz.join(' ') : (typeof clazz === 'string' ? clazz : undefined); |
|
148 | 151 |
|
149 | 152 | // Add title, body |
150 | 153 | if (title) { |
151 | | - const tel = document.createElement('span'); |
152 | 154 | applyCSS(tel, style.title); |
153 | 155 | applyCSS(tel, css.title); |
154 | 156 | tel.textContent = title; |
155 | | - el.appendChild(tel); |
156 | 157 | } |
157 | | - const body = document.createElement('span'); |
158 | 158 | body.textContent = text; |
159 | | - el.appendChild(body); |
160 | 159 | if (footer) { |
161 | | - const fel = el.appendChild(document.createElement('span')); |
162 | 160 | applyCSS(fel, style.footer); |
163 | 161 | applyCSS(fel, css.footer); |
164 | 162 | fel.textContent = footer; |
|
224 | 222 | applyCSS(elb, prev); |
225 | 223 | prev = {}; |
226 | 224 | }; |
227 | | - el.appendChild(elb); |
| 225 | + el.insertBefore(elb, fel); |
228 | 226 | }); |
229 | 227 | } |
230 | 228 | el.addEventListener('click', toast.closed); |
|
0 commit comments