Skip to content

Commit

Permalink
Merge pull request #64 from prousseau-korem/patch-1
Browse files Browse the repository at this point in the history
Offset IE11 compatibility
  • Loading branch information
apvarun authored Oct 10, 2020
2 parents dfd17fc + 65874d6 commit c2ba48e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/toastify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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 + ")";

}

Expand Down

0 comments on commit c2ba48e

Please sign in to comment.