diff --git a/CHANGELOG.md b/CHANGELOG.md index aa9a815..09da013 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All the changes made to toastify-js library. +## [1.7.0] - 2020-03-01 + +* To be able to set `stopOnFocus` for toasts without close icon +* Bugfix: `duration` can be infinite by setting as `0` +* Bugfix: Prevent errors when parent node is removed from DOM while using frameworks +* Bugfix: IE 9/10 compatibility fix + ## [1.6.2] - 2020-01-03 * Bugfix: Closing the toast when custom close icon from icon fonts are used diff --git a/README.md b/README.md index 7078ca6..7c803c7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![forthebadge](https://forthebadge.com/images/badges/made-with-javascript.svg) ![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg) -[![toastify-js](https://img.shields.io/badge/toastify--js-1.6.2-brightgreen.svg)](https://www.npmjs.com/package/toastify-js) +[![toastify-js](https://img.shields.io/badge/toastify--js-1.7.0-brightgreen.svg)](https://www.npmjs.com/package/toastify-js) Toastify is a lightweight, vanilla JS toast notification library. @@ -74,7 +74,7 @@ And the script at the bottom of the page ```javascript Toastify({ text: "This is a toast", - duration: 3000, + duration: 3000, destination: "https://github.com/apvarun/toastify-js", newWindow: true, close: true, @@ -104,6 +104,25 @@ Toastify({ Multiple classes also can be assigned as a string, with spaces between class names. +## API + +| Option Key | type | Usage | Defaults | +|-----------------|----------------------|----------------------------------------------------------------------------|-------------| +| text | string | Message to be displayed in the toast | "Hi there!" | +| duration | number | Duration for which the toast should be displayed.
0 for permanent toast | 3000 | +| selector | string | CSS Selector on which the toast should be added | body | +| destination | URL string | URL to which the browser should be navigated on click of the toast | | +| newWindow | boolean | Decides whether the `destination` should be opened in a new window or not | false | +| close | boolean | To show the close icon or not | false | +| gravity | "top" or "bottom" | To show the toast from top or bottom | "top" | +| position | "left" or "right" | To show the toast on left or right | "right" | +| backgroundColor | CSS background value | Sets the background color of the toast | | +| avatar | URL string | Image/icon to be shown before text | | +| className | string | Ability to provide custom class name for further customization | | +| stopOnFocus | boolean | To stop timer when hovered over the toast (Only if duration is set) | true | +| callback | Function | Invoked when the toast is dismissed | | +| onClick | Function | Invoked when the toast is clicked | | + ## Browsers support | ![][ie]
IE / Edge | ![][firefox]
Firefox | ![][chrome]
Chrome | ![][safari]
Safari | ![][opera]
Opera | @@ -115,9 +134,94 @@ Multiple classes also can be assigned as a string, with spaces between class nam -| [![rndevfx](https://avatars2.githubusercontent.com/u/5052076?v=3&s=80)](https://github.com/rndevfx) | [![Wachiwi](https://avatars1.githubusercontent.com/u/4199845?v=3&s=80)](https://github.com/Wachiwi) | -| :--:|:--: | -| [rndevfx](https://github.com/rndevfx) | [Wachiwi](https://github.com/Wachiwi) | + + + + + + + + + + + + + + + + + + + + + + + +
+ haydster7 +
haydster7
+
+ fiatjaf +
fiatjaf
+
+ victorfeijo +
victorfeijo
+
+ t12ung +
t12ung
+
+ Tadaz +
Tadaz
+
+ mort3za +
mort3za
+
+ Wachiwi +
Wachiwi
+
+ gavinhungry +
gavinhungry
+
+ juliushaertl +
juliushaertl
+
+ skjnldsv +
skjnldsv
+
+ danielkaiser80 +
danielkaiser80
+
+ d4rn0k +
d4rn0k
+
+ GodzzZZZ +
GodzzZZZ
+
+ caiomoura1994 +
caiomoura1994
+
+ rndevfx +
rndevfx
+
+ apvarun +
apvarun
+
diff --git a/package.json b/package.json index 29972e3..9ca5f71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "toastify-js", - "version": "1.6.2", + "version": "1.7.0", "description": "Toastify is a lightweight, vanilla JS toast notification library.", "main": "./src/toastify.js", diff --git a/src/toastify.css b/src/toastify.css index 8804e22..df3b680 100644 --- a/src/toastify.css +++ b/src/toastify.css @@ -1,5 +1,5 @@ /*! - * Toastify js 1.6.2 + * Toastify js 1.7.0 * https://github.com/apvarun/toastify-js * @license MIT licensed * diff --git a/src/toastify.js b/src/toastify.js index 398aca8..8bf2e5e 100644 --- a/src/toastify.js +++ b/src/toastify.js @@ -1,5 +1,5 @@ /*! - * Toastify js 1.6.2 + * Toastify js 1.7.0 * https://github.com/apvarun/toastify-js * @license MIT licensed * @@ -18,7 +18,7 @@ return new Toastify.lib.init(options); }, // Library version - version = "1.6.2"; + version = "1.7.0"; // Defining the prototype of the object Toastify.lib = Toastify.prototype = {