Skip to content

Commit

Permalink
v2.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Dec 17, 2017
1 parent a0f4b9a commit a22acb2
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 70 deletions.
30 changes: 10 additions & 20 deletions dist/tippy.all.js
Expand Up @@ -3200,6 +3200,15 @@ var T = (function () {
applyTransitionDuration([popper], options.updateDuration);
}

// Set initial position near the cursor
if (options.followCursor && !browser.usingTouch) {
_this.popperInstance.disableEventListeners();
var delay = Array.isArray(options.delay) ? options.delay[0] : options.delay;
if (_this._(key).lastTriggerEvent) {
_this._(key).followCursorListener(delay && _this._(key).lastMouseMoveEvent ? _this._(key).lastMouseMoveEvent : _this._(key).lastTriggerEvent);
}
}

// Re-apply transition durations
applyTransitionDuration([tooltip, backdrop, backdrop ? content : null], duration);

Expand Down Expand Up @@ -3289,6 +3298,7 @@ var T = (function () {

if (!_this2._(key).isPreparingToShow) {
document.removeEventListener('mousemove', _this2._(key).followCursorListener);
_this2._(key).lastMouseMoveEvent = null;
}

_this2.popperInstance.disableEventListeners();
Expand Down Expand Up @@ -3588,7 +3598,6 @@ var T = (function () {
this.popperInstance = _createPopperInstance.call(this);
} else {
this.popper.style[prefix('transform')] = null;

this.popperInstance.scheduleUpdate();

if (!this.options.followCursor || browser.usingTouch) {
Expand All @@ -3609,14 +3618,6 @@ var T = (function () {
if (!this.options.appendTo.contains(this.popper)) {
this.options.appendTo.appendChild(this.popper);
}

// Set initial position near cursor
if (this.options.followCursor && !browser.usingTouch) {
this.popperInstance.disableEventListeners();
defer(function () {
_this8._(key).followCursorListener(_this8._(key).lastMouseMoveEvent || _this8._(key).lastTriggerEvent);
});
}
}

/**
Expand Down Expand Up @@ -3657,17 +3658,6 @@ var T = (function () {

var PADDING = 5;

// Obscure case: If the user scrolled to the element without moving
// their mouse, it would be at the wrong position.
if (_this9.reference.getBoundingClientRect) {
var rect = _this9.reference.getBoundingClientRect();
var oY = window.scrollY || document.documentElement.scrollTop;
var oX = window.scrollX || document.documentElement.scrollLeft;
if (_this9.state.visible && _this9._(key).isPreparingToShow && (pageX < rect.left + oX || pageX > rect.right + oX || pageY > rect.bottom + oY || pageY < rect.top + oY)) {
return;
}
}

var placement = _this9.options.placement.replace(/-.+/, '');
if (_this9.popper.getAttribute('x-placement')) {
placement = getPopperPlacement(_this9.popper);
Expand Down
2 changes: 1 addition & 1 deletion dist/tippy.all.min.js

Large diffs are not rendered by default.

30 changes: 10 additions & 20 deletions dist/tippy.js
Expand Up @@ -3198,6 +3198,15 @@ var T = (function () {
applyTransitionDuration([popper], options.updateDuration);
}

// Set initial position near the cursor
if (options.followCursor && !browser.usingTouch) {
_this.popperInstance.disableEventListeners();
var delay = Array.isArray(options.delay) ? options.delay[0] : options.delay;
if (_this._(key).lastTriggerEvent) {
_this._(key).followCursorListener(delay && _this._(key).lastMouseMoveEvent ? _this._(key).lastMouseMoveEvent : _this._(key).lastTriggerEvent);
}
}

// Re-apply transition durations
applyTransitionDuration([tooltip, backdrop, backdrop ? content : null], duration);

Expand Down Expand Up @@ -3287,6 +3296,7 @@ var T = (function () {

if (!_this2._(key).isPreparingToShow) {
document.removeEventListener('mousemove', _this2._(key).followCursorListener);
_this2._(key).lastMouseMoveEvent = null;
}

_this2.popperInstance.disableEventListeners();
Expand Down Expand Up @@ -3586,7 +3596,6 @@ var T = (function () {
this.popperInstance = _createPopperInstance.call(this);
} else {
this.popper.style[prefix('transform')] = null;

this.popperInstance.scheduleUpdate();

if (!this.options.followCursor || browser.usingTouch) {
Expand All @@ -3607,14 +3616,6 @@ var T = (function () {
if (!this.options.appendTo.contains(this.popper)) {
this.options.appendTo.appendChild(this.popper);
}

// Set initial position near cursor
if (this.options.followCursor && !browser.usingTouch) {
this.popperInstance.disableEventListeners();
defer(function () {
_this8._(key).followCursorListener(_this8._(key).lastMouseMoveEvent || _this8._(key).lastTriggerEvent);
});
}
}

/**
Expand Down Expand Up @@ -3655,17 +3656,6 @@ var T = (function () {

var PADDING = 5;

// Obscure case: If the user scrolled to the element without moving
// their mouse, it would be at the wrong position.
if (_this9.reference.getBoundingClientRect) {
var rect = _this9.reference.getBoundingClientRect();
var oY = window.scrollY || document.documentElement.scrollTop;
var oX = window.scrollX || document.documentElement.scrollLeft;
if (_this9.state.visible && _this9._(key).isPreparingToShow && (pageX < rect.left + oX || pageX > rect.right + oX || pageY > rect.bottom + oY || pageY < rect.top + oY)) {
return;
}
}

var placement = _this9.options.placement.replace(/-.+/, '');
if (_this9.popper.getAttribute('x-placement')) {
placement = getPopperPlacement(_this9.popper);
Expand Down
2 changes: 1 addition & 1 deletion dist/tippy.min.js

Large diffs are not rendered by default.

30 changes: 10 additions & 20 deletions dist/tippy.standalone.js
Expand Up @@ -771,6 +771,15 @@ var T = (function () {
applyTransitionDuration([popper], options.updateDuration);
}

// Set initial position near the cursor
if (options.followCursor && !browser.usingTouch) {
_this.popperInstance.disableEventListeners();
var delay = Array.isArray(options.delay) ? options.delay[0] : options.delay;
if (_this._(key).lastTriggerEvent) {
_this._(key).followCursorListener(delay && _this._(key).lastMouseMoveEvent ? _this._(key).lastMouseMoveEvent : _this._(key).lastTriggerEvent);
}
}

// Re-apply transition durations
applyTransitionDuration([tooltip, backdrop, backdrop ? content : null], duration);

Expand Down Expand Up @@ -860,6 +869,7 @@ var T = (function () {

if (!_this2._(key).isPreparingToShow) {
document.removeEventListener('mousemove', _this2._(key).followCursorListener);
_this2._(key).lastMouseMoveEvent = null;
}

_this2.popperInstance.disableEventListeners();
Expand Down Expand Up @@ -1159,7 +1169,6 @@ var T = (function () {
this.popperInstance = _createPopperInstance.call(this);
} else {
this.popper.style[prefix('transform')] = null;

this.popperInstance.scheduleUpdate();

if (!this.options.followCursor || browser.usingTouch) {
Expand All @@ -1180,14 +1189,6 @@ var T = (function () {
if (!this.options.appendTo.contains(this.popper)) {
this.options.appendTo.appendChild(this.popper);
}

// Set initial position near cursor
if (this.options.followCursor && !browser.usingTouch) {
this.popperInstance.disableEventListeners();
defer(function () {
_this8._(key).followCursorListener(_this8._(key).lastMouseMoveEvent || _this8._(key).lastTriggerEvent);
});
}
}

/**
Expand Down Expand Up @@ -1228,17 +1229,6 @@ var T = (function () {

var PADDING = 5;

// Obscure case: If the user scrolled to the element without moving
// their mouse, it would be at the wrong position.
if (_this9.reference.getBoundingClientRect) {
var rect = _this9.reference.getBoundingClientRect();
var oY = window.scrollY || document.documentElement.scrollTop;
var oX = window.scrollX || document.documentElement.scrollLeft;
if (_this9.state.visible && _this9._(key).isPreparingToShow && (pageX < rect.left + oX || pageX > rect.right + oX || pageY > rect.bottom + oY || pageY < rect.top + oY)) {
return;
}
}

var placement = _this9.options.placement.replace(/-.+/, '');
if (_this9.popper.getAttribute('x-placement')) {
placement = getPopperPlacement(_this9.popper);
Expand Down
2 changes: 1 addition & 1 deletion dist/tippy.standalone.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/index.html
Expand Up @@ -184,16 +184,16 @@ <h2><a href="#getting-started"><i class="material-icons icon-left">tag_faces</i>
<p>
Alternatively, you can install through npm:
</p>
<pre><code>npm install --save tippy.js@2.0.7</code></pre>
<pre><code>npm install --save tippy.js@2.0.8</code></pre>

<p>
or use the <a target="_blank" href="https://unpkg.com/tippy.js@2.0.7">unpkg.com CDN</a>:
or use the <a target="_blank" href="https://unpkg.com/tippy.js@2.0.8">unpkg.com CDN</a>:
</p>

<pre><code>https://unpkg.com/tippy.js@2.0.7/dist/</code></pre>
<pre><code>https://unpkg.com/tippy.js@2.0.8/dist/</code></pre>

<p>Simply include the <code>tippy.all.min.js</code> file in your document before your own scripts:</p>
<pre><code class="language-markup">&lt;script src="https://unpkg.com/tippy.js@2.0.7/dist/tippy.all.min.js"&gt;&lt;/script&gt;</code></pre>
<pre><code class="language-markup">&lt;script src="https://unpkg.com/tippy.js@2.0.8/dist/tippy.all.min.js"&gt;&lt;/script&gt;</code></pre>

<p>This is the bundled version which includes Popper.js and automatically injects Tippy's CSS stylesheet
into the document head.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/tippy/tippy.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "tippy.js",
"version": "2.0.7",
"version": "2.0.8",
"description": "Vanilla JS Tooltip Library",
"main": "dist/tippy.all.js",
"repository": {
Expand All @@ -16,7 +16,7 @@
"standalone": "rollup -c scripts/rollup.standalone.config.js && rollup -c scripts/rollup.standalone.min.config.js",
"themes": "rollup -c scripts/rollup.themes.config.js",
"test": "rollup -c scripts/rollup.tests.config.js --format es && karma start karma.conf.js",
"prettier": "prettier --print-width 100 --no-semi --single-quote --trailing-comma es5 --write 'src/**/*.js'"
"prettier": "prettier --print-width 80 --no-semi --single-quote es5 --write 'src/**/*.js'"
},
"author": "atomiks",
"license": "MIT",
Expand Down

0 comments on commit a22acb2

Please sign in to comment.