Skip to content

Commit

Permalink
upload v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelodolza committed Nov 18, 2016
1 parent 3056551 commit 4b8af23
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 23 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Fast | Responsive | Animated | Lightweight | Customizable | No dependencies | Re
___
### Version Log

- **v1.0.0** - released
- **v1.0.1**
- ![alt text][new] Internet Explorer support - *Implemented.*

___
### Install
Expand Down
2 changes: 1 addition & 1 deletion css/iziToast.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* iziToast | v1.0.0
* iziToast | v1.0.1
* http://izitoast.marcelodolce.com
* by Marcelo Dolce.
*/
Expand Down
2 changes: 1 addition & 1 deletion css/iziToast.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 38 additions & 17 deletions js/iziToast.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*
* iziToast | v1.0.0
* iziToast | v1.0.1
* http://izitoast.marcelodolce.com
* by Marcelo Dolce.
*/

(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory(root));
Expand Down Expand Up @@ -63,6 +62,17 @@
//


/**
* Polyfill for remove() method
*/
if (!('remove' in Element.prototype)) {
Element.prototype.remove = function() {
if (this.parentNode) {
this.parentNode.removeChild(this);
}
};
}

/**
* A simple forEach() implementation for Arrays, Objects and NodeLists
* @private
Expand Down Expand Up @@ -382,14 +392,18 @@
}

if (settings.class){
var event;
if (window.CustomEvent) {
event = new CustomEvent('iziToast-close', {detail: {class: settings.class}});
} else {
event = document.createEvent('CustomEvent');
event.initCustomEvent('iziToast-close', true, true, {class: settings.class});
try {
var event;
if (window.CustomEvent) {
event = new CustomEvent('iziToast-close', {detail: {class: settings.class}});
} else {
event = document.createEvent('CustomEvent');
event.initCustomEvent('iziToast-close', true, true, {class: settings.class});
}
document.dispatchEvent(event);
} catch(ex){
console.warn(ex);
}
document.dispatchEvent(event);
}

if(typeof settings.onClose !== "undefined")
Expand Down Expand Up @@ -586,6 +600,8 @@
var position = settings.position,
$wrapper;



if(settings.target){

$wrapper = document.querySelector(settings.target);
Expand All @@ -610,7 +626,8 @@

if (!$wrapper) {
$wrapper = document.createElement("div");
$wrapper.classList.add(PLUGIN_NAME + '-wrapper', position);
$wrapper.classList.add(PLUGIN_NAME + '-wrapper');
$wrapper.classList.add(position);
document.body.appendChild($wrapper);
}
if(settings.position == "topLeft" || settings.position == "topCenter" || settings.position == "topRight"){
Expand All @@ -622,14 +639,18 @@

settings.onOpen.apply();

var event;
if (window.CustomEvent) {
event = new CustomEvent('iziToast-open', {detail: {class: settings.class}});
} else {
event = document.createEvent('CustomEvent');
event.initCustomEvent('iziToast-open', true, true, {class: settings.class});
try {
var event;
if (window.CustomEvent) {
event = new CustomEvent('iziToast-open', {detail: {class: settings.class}});
} else {
event = document.createEvent('CustomEvent');
event.initCustomEvent('iziToast-open', true, true, {class: settings.class});
}
document.dispatchEvent(event);
} catch(ex){
console.warn(ex);
}
document.dispatchEvent(event);

if(settings.animateInside){
$toast.classList.add(PLUGIN_NAME+'-animateInside');
Expand Down
4 changes: 2 additions & 2 deletions js/iziToast.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4b8af23

Please sign in to comment.