From 65874d67639fb47bc33fbf8fe86eccec8511452e Mon Sep 17 00:00:00 2001 From: prousseau-korem <59747802+prousseau-korem@users.noreply.github.com> Date: Tue, 6 Oct 2020 15:35:06 -0400 Subject: [PATCH] Offset IE11 compatibility --- src/toastify.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/toastify.js b/src/toastify.js index 91e160c..23dcdec 100644 --- a/src/toastify.js +++ b/src/toastify.js @@ -56,9 +56,7 @@ this.options.stopOnFocus = options.stopOnFocus === undefined? true: options.stopOnFocus; // stop timeout on focus this.options.onClick = options.onClick; // Callback after click - const normalOffset = { x: 0, y: 0 }; - - this.options.offset = options.offset || normalOffset // toast offset + this.options.offset = options.offset || { x: 0, y: 0 }; // toast offset // Returning the current object for chaining functions return this; @@ -153,7 +151,7 @@ // Clear timeout while toast is focused if (this.options.stopOnFocus && this.options.duration > 0) { - const self = this; + var self = this; // stop countdown divElement.addEventListener( "mouseover", @@ -207,10 +205,10 @@ var x = getAxisOffsetAValue("x", this.options); var y = getAxisOffsetAValue("y", this.options); - const xOffset = this.options.position == "left" ? x : `-${x}`; - const yOffset = this.options.gravity == "toastify-top" ? y : `-${y}`; + var xOffset = this.options.position == "left" ? x : "-" + x; + var yOffset = this.options.gravity == "toastify-top" ? y : "-" + y; - divElement.style.transform = `translate(${xOffset}, ${yOffset})`; + divElement.style.transform = "translate(" + xOffset + "," + yOffset + ")"; }