Skip to content

Commit

Permalink
Improve ie compatibility (#92)
Browse files Browse the repository at this point in the history
* Use getAttribute instead of dataset property

This is required because ie11 does not support the dataset property on
svg elements

* Remove use of template string

These are not ie11 compatible

* Bump version to 1.2.1
  • Loading branch information
harrywhite4 authored May 4, 2020
1 parent 6ad46fd commit d2c3fd3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
## 1.2.0

- Add selector option

## 1.2.1

- Fix ie compatibility issues with svg's and error display
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aristotle-metadata-enterprises/aristotle_tooltip",
"version": "1.2.0",
"version": "1.2.1",
"description": "Aristotle Tooltip: add Aristotle functionality to any website!",
"main": "dist/aristotletooltip.min.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function getStartNode(selection) {
if (type === 'object' && selection instanceof Element) {
return selection;
}
console.log(`${selection} is not a valid selector`);
console.log(selection.toString() + ' is not a valid selector');
return document.body;
}

Expand All @@ -83,7 +83,7 @@ function createTippyElements(options) {
// Create a Tippy object for each element that has an attached aristotle id:
for (let i = 0; i < elements.length; i++) {
const element = elements[i];
const aristotleId = element.dataset.aristotleConceptId;
const aristotleId = element.getAttribute('data-aristotle-concept-id');
tippy(element, {
theme: 'light-border',
placement: options.placement,
Expand Down

0 comments on commit d2c3fd3

Please sign in to comment.