Skip to content

Commit

Permalink
add if closed by timeout or click
Browse files Browse the repository at this point in the history
issue marcelodolza#8

Possibilita saber se foi fechado via timeout ou via click
  • Loading branch information
emtudo authored Nov 28, 2016
1 parent 5a1bfb2 commit a9082a1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dist/js/iziToast.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@
* @public
* @param {Object} options User settings
*/
iziToast.hide = function (options, $toast) {
iziToast.hide = function (options, $toast, closed) {
var isClosed=closed || false;

var settings = extend(defaults, options || {});

Expand Down Expand Up @@ -399,7 +400,7 @@
}

if(typeof settings.onClose !== "undefined")
settings.onClose.apply();
settings.onClose.apply(null, [isClosed]);
};

/**
Expand Down Expand Up @@ -696,7 +697,7 @@
if($buttonClose){
$buttonClose.addEventListener('click', function (event) {
var button = event.target;
that.hide(settings, $toast);
that.hide(settings, $toast, true);
});
}

Expand All @@ -721,4 +722,4 @@
};

return iziToast;
});
});

0 comments on commit a9082a1

Please sign in to comment.