From ed8489f21ae2f0b26bd395a2d5d1a8dd66c5e263 Mon Sep 17 00:00:00 2001 From: Aaren San Date: Tue, 30 Jul 2019 16:21:51 +0200 Subject: [PATCH] update toastr.js for jquery 3.x Some small changes to get it work with jquery 3.x --- toastr.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toastr.js b/toastr.js index 1f804394..c3f67d00 100644 --- a/toastr.js +++ b/toastr.js @@ -286,15 +286,15 @@ function handleEvents() { if (options.closeOnHover) { - $toastElement.hover(stickAround, delayedHideToast); + $toastElement.on("mouseenter", stickAround).on("mouseleave", delayedHideToast); } if (!options.onclick && options.tapToDismiss) { - $toastElement.click(hideToast); + $toastElement.on("click", hideToast); } if (options.closeButton && $closeElement) { - $closeElement.click(function (event) { + $closeElement.on("click", function (event) { if (event.stopPropagation) { event.stopPropagation(); } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) { @@ -310,7 +310,7 @@ } if (options.onclick) { - $toastElement.click(function (event) { + $toastElement.on("click", function (event) { options.onclick(event); hideToast(); });