Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
AUI-1092 - Class tooltip-hidden should not be on tooltip element when…
Browse files Browse the repository at this point in the history
… it is visible
  • Loading branch information
pat270 authored and eduardolundgren committed Feb 5, 2014
1 parent 1c6af60 commit 377a255
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
3 changes: 3 additions & 0 deletions src/aui-tooltip/assets/aui-tooltip-base-core.css
@@ -0,0 +1,3 @@
.tooltip-hidden {
z-index: -1 !important;
}
37 changes: 18 additions & 19 deletions src/aui-tooltip/js/aui-tooltip-base.js
Expand Up @@ -52,7 +52,6 @@ A.Tooltip = A.Base.create(TOOLTIP, A.Widget, [
A.WidgetPositionAlign,
A.WidgetPositionAlignSuggestion,
A.WidgetPositionConstrain,
A.WidgetStack,
A.WidgetTrigger
], {
/**
Expand Down Expand Up @@ -101,15 +100,18 @@ A.Tooltip = A.Base.create(TOOLTIP, A.Widget, [
* @protected
*/
bindUI: function() {
var instance = this;
var instance = this,
trigger = instance.get(TRIGGER);

// Do not bind the synthetic hover event to the widget dom events
// wrapper api. Hover bind method has a different method signature which
// is not handled by widget yet. Bind to the `boundingBox` instead.
instance.get(TRIGGER).on(
HOVER,
A.bind(instance._onBoundingBoxMouseenter, this)
);
if (trigger) {
trigger.on(
HOVER,
A.bind(instance._onBoundingBoxMouseenter, instance),
A.bind(instance._onBoundingBoxMouseleave, instance));
}

instance.get(BOUNDING_BOX).on(
HOVER,
Expand Down Expand Up @@ -137,14 +139,17 @@ A.Tooltip = A.Base.create(TOOLTIP, A.Widget, [
* @protected
*/
_afterUiSetVisible: function(val) {
var instance = this;
var instance = this,
stickDuration = instance.get(STICK_DURATION);

if (val) {
instance._loadBodyContentFromTitle();
instance._maybeShow();
}
else {
instance._maybeHide();
if (!A.Lang.isNumber(stickDuration)) {
instance._maybeHide();
}
}
},

Expand Down Expand Up @@ -225,6 +230,7 @@ A.Tooltip = A.Base.create(TOOLTIP, A.Widget, [
}
else {
instance._transition();
instance.hide();
}
},

Expand Down Expand Up @@ -285,6 +291,10 @@ A.Tooltip = A.Base.create(TOOLTIP, A.Widget, [
},
function() {
boundingBox.toggleClass(IN, fadeIn);

if (!fadeIn) {
instance.hide();
}
}
);
}
Expand Down Expand Up @@ -364,17 +374,6 @@ A.Tooltip = A.Base.create(TOOLTIP, A.Widget, [
validator: A.Lang.isNumber
},

/**
* DOM event to hide the tooltip.
*
* @attribute triggerHideEvent
* @default mouseleave
* @type String
*/
triggerHideEvent: {
value: MOUSELEAVE
},

/**
* DOM event to show the tooltip.
*
Expand Down

0 comments on commit 377a255

Please sign in to comment.