Skip to content

Commit ca0edba

Browse files
author
Daniel Hochleitner
committed
version 1.2
- removed unsupported positions like top-left, bottom-right from plugin --> tooltipster migration guide: calebjacob/tooltipster#566)) - upgraded tooltipster to newest version 4.1.5
1 parent eb24e2a commit ca0edba

File tree

7 files changed

+1437
-1438
lines changed

7 files changed

+1437
-1438
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
A powerful, flexible APEX plugin enabling you to easily create semantic, modern tooltips. Using the open source JQuery plugin tooltipster.
33

44
## Changelog
5+
### 1.2 - Removed unsupported positions like top-left, bottom-right from plugin ([tooltipster migration guide](https://github.com/iamceege/tooltipster/issues/566)) / upgraded tooltipster to newest version 4.1.5
6+
57
### 1.1 - Added text source (freetext, text from item, text from title attribute of affected element) / upgraded tooltipster to newest version 4.1.2
68

79
### 1.0 - Initial Release

apexplugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name" : "APEX Tooltip",
3-
"version" : "1.1",
3+
"version" : "1.2",
44
"description" : "A powerful, flexible APEX plugin enabling you to easily create semantic, modern tooltips.",
55
"keywords" : ["tooltip", "popover", "hover"],
66
"homepage" : "https://github.com/Dani3lSun/apex-plugin-apextooltip",

server/js/apextooltip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// APEX Tooltip functions
22
// Author: Daniel Hochleitner
3-
// Version: 1.1
3+
// Version: 1.2
44

55
// global namespace
66
var apexTooltip = {

server/js/tooltipster.bundle.js

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ var defaults = {
8989
hasTransitions: transitionSupport(),
9090
IE: false,
9191
// don't set manually, it will be updated by a build task after the manifest
92-
semVer: '4.1.2',
92+
semVer: '4.1.5',
9393
window: win
9494
},
9595
core = function() {
@@ -875,8 +875,8 @@ $.Tooltipster.prototype = {
875875
geo.origin.windowOffset.right = geo.origin.windowOffset.left + geo.origin.size.width;
876876
geo.origin.windowOffset.bottom = geo.origin.windowOffset.top + geo.origin.size.height;
877877

878-
geo.origin.offset.left = geo.origin.windowOffset.left + env.window.scrollX;
879-
geo.origin.offset.top = geo.origin.windowOffset.top + env.window.scrollY;
878+
geo.origin.offset.left = geo.origin.windowOffset.left + geo.window.scroll.left;
879+
geo.origin.offset.top = geo.origin.windowOffset.top + geo.window.scroll.top;
880880
geo.origin.offset.bottom = geo.origin.offset.top + geo.origin.size.height;
881881
geo.origin.offset.right = geo.origin.offset.left + geo.origin.size.width;
882882

@@ -1555,7 +1555,8 @@ $.Tooltipster.prototype = {
15551555
// call our constructor custom callback function
15561556
if (self.__options.functionAfter) {
15571557
self.__options.functionAfter.call(self, self, {
1558-
event: event
1558+
event: event,
1559+
origin: self._$origin[0]
15591560
});
15601561
}
15611562

@@ -2786,27 +2787,31 @@ $.Tooltipster.prototype = {
27862787

27872788
if (!self.__destroyed) {
27882789

2789-
// if the tooltip has not been removed from DOM manually (or if it
2790-
// has been detached on purpose)
2791-
if (bodyContains(self._$tooltip) || tooltipIsDetached) {
2792-
2793-
if (!tooltipIsDetached) {
2794-
// detach in case the tooltip overflows the window and adds
2795-
// scrollbars to it, so __geometry can be accurate
2796-
self._$tooltip.detach();
2797-
}
2790+
// if the tooltip is still open and the origin is still in the DOM
2791+
if (self.__state != 'closed' && bodyContains(self._$origin)) {
27982792

2799-
// refresh the geometry object before passing it as a helper
2800-
self.__Geometry = self.__geometry();
2801-
2802-
// let a plugin fo the rest
2803-
self._trigger({
2804-
type: 'reposition',
2805-
event: event,
2806-
helper: {
2807-
geo: self.__Geometry
2793+
// if the tooltip has not been removed from DOM manually (or if it
2794+
// has been detached on purpose)
2795+
if (tooltipIsDetached || bodyContains(self._$tooltip)) {
2796+
2797+
if (!tooltipIsDetached) {
2798+
// detach in case the tooltip overflows the window and adds
2799+
// scrollbars to it, so __geometry can be accurate
2800+
self._$tooltip.detach();
28082801
}
2809-
});
2802+
2803+
// refresh the geometry object before passing it as a helper
2804+
self.__Geometry = self.__geometry();
2805+
2806+
// let a plugin fo the rest
2807+
self._trigger({
2808+
type: 'reposition',
2809+
event: event,
2810+
helper: {
2811+
geo: self.__Geometry
2812+
}
2813+
});
2814+
}
28102815
}
28112816
}
28122817
else {
@@ -3229,8 +3234,13 @@ Ruler.prototype = {
32293234
result.fits = fits.height && fits.width;
32303235
}
32313236

3232-
// old versions of IE get the width wrong for some reason
3233-
if (env.IE && env.IE <= 11) {
3237+
// old versions of IE get the width wrong for some reason and it causes
3238+
// the text to be broken to a new line, so we round it up. If the width
3239+
// is the width of the screen though, we can assume it is accurate.
3240+
if ( env.IE
3241+
&& env.IE <= 11
3242+
&& result.size.width !== env.window.document.documentElement.clientWidth
3243+
) {
32343244
result.size.width = Math.ceil(result.size.width) + 1;
32353245
}
32363246

@@ -3566,7 +3576,13 @@ $.tooltipster._plugin({
35663576
var $clone = self.__instance._$tooltip.clone(),
35673577
// start position tests session
35683578
ruler = $.tooltipster._getRuler($clone),
3569-
satisfied = false;
3579+
satisfied = false,
3580+
animation = self.__instance.option('animation');
3581+
3582+
// an animation class could contain properties that distort the size
3583+
if (animation) {
3584+
$clone.removeClass('tooltipster-'+ animation);
3585+
}
35703586

35713587
// start evaluating scenarios
35723588
$.each(['window', 'document'], function(i, container) {

server/js/tooltipster.bundle.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)