From bc41909e7ade0f001b0252a6608aee5b93f9f4e9 Mon Sep 17 00:00:00 2001 From: Tanner Linsley Date: Fri, 23 Oct 2015 12:40:38 -0600 Subject: [PATCH] Track lastTooltipActive for change animations Since we split up the hover and tooltips modes, both changes need to be tracked for visual updates between the two. --- src/core/core.controller.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 45e8869e5..13695081a 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -371,6 +371,7 @@ }, eventHandler: function eventHandler(e) { this.lastActive = this.lastActive || []; + this.lastTooltipActive = this.lastTooltipActive || []; // Find Active Elements for hover and tooltips if (e.type == 'mouseout') { @@ -484,10 +485,19 @@ } }, this); + helpers.each(this.tooltipActive, function(element, index) { + if (element !== this.lastTooltipActive[index]) { + changed = true; + } + }, this); + // If entering, leaving, or changing elements, animate the change via pivot if ((!this.lastActive.length && this.active.length) || (this.lastActive.length && !this.active.length) || - (this.lastActive.length && this.active.length && changed)) { + (this.lastActive.length && this.active.length && changed) || + (!this.lastTooltipActive.length && this.tooltipActive.length) || + (this.lastTooltipActive.length && !this.tooltipActive.length) || + (this.lastTooltipActive.length && this.tooltipActive.length && changed)) { this.stop(); @@ -497,8 +507,9 @@ } } - // Remember Last Active + // Remember Last Actives this.lastActive = this.active; + this.lastTooltipActive = this.tooltipActive; return this; }, });