Skip to content

Commit

Permalink
upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
clarketm committed Jun 9, 2019
1 parent 0a52980 commit 93e4bf4
Show file tree
Hide file tree
Showing 6 changed files with 507 additions and 442 deletions.
2 changes: 1 addition & 1 deletion dist/image-map.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance");
}

var version = "1.1.5";
var version = "1.1.6";

var RESIZE = "resize";
var LOAD = "load";
Expand Down
2 changes: 1 addition & 1 deletion dist/image-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
throw new TypeError("Invalid attempt to spread non-iterable instance");
}

var version = "1.1.5";
var version = "1.1.6";

var RESIZE = "resize";
var LOAD = "load";
Expand Down
2 changes: 1 addition & 1 deletion dist/image-map.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "image-map",
"version": "1.1.5",
"version": "1.1.6",
"description": "Response, dynamic image maps",
"main": "dist/image-map.js",
"module": "dist/image-map.es.js",
Expand Down
4 changes: 2 additions & 2 deletions src/image-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class ImageMap {
[...document.querySelectorAll(ImageMap.genAreaSelector(mapName))].forEach(area => {
const coordsString = (area.dataset[COORDS] = area.dataset[COORDS] || area.getAttribute(COORDS));
const coordsArrayOld = coordsString.split(",");
const coordsArrayNew = coordsArrayOld.map(
(_, i) => (i % 2 === 0 ? Number((coordsArrayOld[i] / w) * 100 * wPercent) : Number((coordsArrayOld[i] / h) * 100 * hPercent))
const coordsArrayNew = coordsArrayOld.map((_, i) =>
i % 2 === 0 ? Number((coordsArrayOld[i] / w) * 100 * wPercent) : Number((coordsArrayOld[i] / h) * 100 * hPercent)
);
area.setAttribute(COORDS, coordsArrayNew.toString());
});
Expand Down
Loading

0 comments on commit 93e4bf4

Please sign in to comment.