|
18 | 18 | * @property {boolean} close - To show the close icon or not |
19 | 19 | * @property {string} gravity - To show the toast from top or bottom |
20 | 20 | * @property {string} position - To show the toast on left or right |
21 | | - * @property {string} backgroundColor - Sets the background color of the toast (to be deprecated) |
| 21 | + * @property {string} backgroundColor - Deprecated: Sets the background color of the toast |
22 | 22 | * @property {url} avatar - Image/icon to be shown before text |
23 | 23 | * @property {string} className - Ability to provide custom class name for further customization |
24 | 24 | * @property {boolean} stopOnFocus - To stop timer when hovered over the toast (Only if duration is set) |
@@ -166,6 +166,12 @@ class Toastify { |
166 | 166 | escapeMarkup: true, |
167 | 167 | style: {} |
168 | 168 | }, options); |
| 169 | + |
| 170 | + if (this.options.backgroundColor) { |
| 171 | + // This is being deprecated in favor of using the style HTML DOM property |
| 172 | + console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.'); |
| 173 | + } |
| 174 | + |
169 | 175 | this.toastElement = null; |
170 | 176 |
|
171 | 177 | this.options.gravity = options.gravity === "bottom" ? "toastify-bottom" : "toastify-top"; // toast position - top or bottom |
@@ -194,11 +200,6 @@ class Toastify { |
194 | 200 |
|
195 | 201 | // Assigning gravity of element |
196 | 202 | divElement.className += ` ${this.options.gravity}`; |
197 | | - |
198 | | - if (this.options.backgroundColor) { |
199 | | - // This is being deprecated in favor of using the style HTML DOM property |
200 | | - console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.'); |
201 | | - } |
202 | 203 |
|
203 | 204 | // Loop through our style object and apply styles to divElement |
204 | 205 | for (const property in this.options.style) { |
|
0 commit comments