From 2c39514359db71369c824d1069cbc353086e0c8d Mon Sep 17 00:00:00 2001 From: damencho Date: Tue, 9 Aug 2016 17:39:24 -0500 Subject: [PATCH] Fixes the check whether we are hovering over the toolbar. --- modules/UI/toolbars/Toolbar.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index e25641089..d0f27ae55 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -428,15 +428,21 @@ const Toolbar = { /** * Indicates if the toolbar is currently hovered. - * @return {true} if the toolbar is currently hovered, {false} otherwise + * @return {boolean} true if the toolbar is currently hovered, + * false otherwise */ isHovered() { + var hovered = false; this.toolbarSelector.find('*').each(function () { let id = $(this).attr('id'); if ($(`#${id}:hover`).length > 0) { - return true; + hovered = true; + // break each + return false; } }); + if (hovered) + return true; if ($("#bottomToolbar:hover").length > 0) { return true; }