Socket
Socket
Sign inDemoInstall

toastify-js

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toastify-js - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

3

CHANGELOG.md
# Changelog
All the changes made to toastify-js library.
## [1.2.0] - 2018-03-05
- Fix issue when `destination` and `close` options is used at the same time
## [1.1.0] - 2018-02-18

@@ -5,0 +8,0 @@ - Browser support extended to IE10+ without any polyfills

3

example/script.js

@@ -21,3 +21,4 @@ var bgColors = [

positionLeft: true,
backgroundColor: "#0f3443"
backgroundColor: "#0f3443",
// avatar: 'https://randomuser.me/api/portraits/women/10.jpg'
}).showToast();

@@ -24,0 +25,0 @@ }, 1000);

{
"name": "toastify-js",
"version": "1.1.0",
"version": "1.2.0",
"description": "Toastify is a lightweight, vanilla JS toast notification library.",

@@ -5,0 +5,0 @@ "main": "./src/toastify.js",

@@ -6,3 +6,3 @@ # Toastify

[![toastify-js](https://img.shields.io/badge/toastify--js-1.1.0-brightgreen.svg)](https://www.npmjs.com/package/toastify-js)
[![toastify-js](https://img.shields.io/badge/toastify--js-1.2.0-brightgreen.svg)](https://www.npmjs.com/package/toastify-js)

@@ -9,0 +9,0 @@ Toastify is a lightweight, vanilla JS toast notification library.

/*!
* Toastify js 1.1.0
* Toastify js 1.2.0
* https://github.com/apvarun/toastify-js

@@ -25,3 +25,3 @@ * @license MIT licensed

// Library version
version = "1.1.0";
version = "1.2.0";

@@ -121,2 +121,3 @@ // Defining the prototype of the object

event.stopPropagation();
this.removeElement(event.target.parentElement);

@@ -149,33 +150,13 @@ window.clearTimeout(event.target.parentElement.timeOutValue);

// Setting up an anchor object
var linkElement = document.createElement("a");
linkElement.setAttribute("href", this.options.destination);
divElement.addEventListener('click', function (event) {
if (this.options.newWindow === true) {
linkElement.setAttribute("target", "_blank");
}
event.stopPropagation();
if(this.options.newWindow === true){
window.open(this.options.destination, '_blank')
} else {
window.location = this.options.destination;
}
// Rectifying class names due to nesting
divElement.className = '';
linkElement.className = 'toastify on';
}.bind(this));
// Positioning toast to left or right
if (this.options.positionLeft === true) {
linkElement.className += " left";
} else {
linkElement.className += " right";
}
// Assigning gravity of element
linkElement.className += " " + this.options.gravity;
divElement.style.background = "";
linkElement.style.background = this.options.backgroundColor;
// Adding the text element inside link
linkElement.appendChild(divElement);
// Returning the linked element
return linkElement;
}

@@ -182,0 +163,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc