[Mobile] Clean Up

Moved Mobile check in InfoGesture to
call on mouseEnter.
This commit is contained in:
Shivam Dave
2015-07-24 15:27:33 -07:00
parent 91bd58215a
commit 011e6fc512

View File

@ -75,10 +75,6 @@ define(
// Also need to track position during hover // Also need to track position during hover
element.on('mousemove', trackPosition); element.on('mousemove', trackPosition);
// Checks if you are on a mobile device, if the device is
// not mobile (queryService.isMobile() = false), then
// the pendingBubble and therefore hovering is allowed
if (!queryService.isMobile(navigator.userAgent)) {
// Show the bubble, after a suitable delay (if mouse has // Show the bubble, after a suitable delay (if mouse has
// left before this time is up, this will be canceled.) // left before this time is up, this will be canceled.)
pendingBubble = $timeout(function () { pendingBubble = $timeout(function () {
@ -92,13 +88,17 @@ define(
pendingBubble = undefined; pendingBubble = undefined;
}, DELAY); }, DELAY);
}
element.on('mouseleave', hideBubble); element.on('mouseleave', hideBubble);
} }
// Checks if you are on a mobile device, if the device is
// not mobile (queryService.isMobile() = false), then
// the pendingBubble and therefore hovering is allowed
if (!queryService.isMobile(navigator.userAgent)) {
// Show bubble (on a timeout) on mouse over // Show bubble (on a timeout) on mouse over
element.on('mouseenter', showBubble); element.on('mouseenter', showBubble);
}
// Also make sure we dismiss bubble if representation is destroyed // Also make sure we dismiss bubble if representation is destroyed
// before the mouse actually leaves it // before the mouse actually leaves it