Skip to content

Commit

Permalink
distance option fix
Browse files Browse the repository at this point in the history
  • Loading branch information
louisameline committed Jun 5, 2020
1 parent f818f58 commit 57423dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "4.2.7"
"version": "4.2.8"
}
15 changes: 7 additions & 8 deletions src/js/plugins/tooltipster/sideTip/tooltipster-sideTip.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,18 @@ $.tooltipster._plugin({
self.__options.distance = [self.__options.distance];
}
if (self.__options.distance.length < 4) {

if (self.__options.distance[1] === undefined) self.__options.distance[1] = self.__options.distance[0];
if (self.__options.distance[2] === undefined) self.__options.distance[2] = self.__options.distance[0];
if (self.__options.distance[3] === undefined) self.__options.distance[3] = self.__options.distance[1];

self.__options.distance = {
top: self.__options.distance[0],
right: self.__options.distance[1],
bottom: self.__options.distance[2],
left: self.__options.distance[3]
};
}

self.__options.distance = {
top: self.__options.distance[0],
right: self.__options.distance[1],
bottom: self.__options.distance[2],
left: self.__options.distance[3]
};

// let's transform:
// 'top' into ['top', 'bottom', 'right', 'left']
// 'right' into ['right', 'left', 'top', 'bottom']
Expand Down

0 comments on commit 57423dc

Please sign in to comment.