Skip to content

Commit

Permalink
fixes onHidden firing twice when clicking on it then moving mouse out…
Browse files Browse the repository at this point in the history
… of it. closes #105
  • Loading branch information
johnpapa committed Apr 29, 2014
1 parent 9e97de8 commit ad613b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions toastr.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
});
}
}

function remove($toastElement) {
var options = getOptions();
if (!$container) { getContainer(options); }
Expand Down Expand Up @@ -260,7 +260,7 @@
easing: options.hideEasing,
complete: function () {
removeToast($toastElement);
if (options.onHidden) {
if (options.onHidden && response.state !== 'hidden') {
options.onHidden();
}
response.state = 'hidden';
Expand Down Expand Up @@ -294,7 +294,7 @@
.addClass(options.positionClass)
.attr('aria-live', 'polite')
.attr('role', 'alert');

$container.appendTo($(options.target));
return $container;
}
Expand Down

0 comments on commit ad613b9

Please sign in to comment.