mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 00:23:01 +00:00
[Mobile] Clean Up
Moved Mobile check in InfoGesture to call on mouseEnter.
This commit is contained in:
@ -75,30 +75,30 @@ 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
|
// Show the bubble, after a suitable delay (if mouse has
|
||||||
// not mobile (queryService.isMobile() = false), then
|
// left before this time is up, this will be canceled.)
|
||||||
// the pendingBubble and therefore hovering is allowed
|
pendingBubble = $timeout(function () {
|
||||||
if (!queryService.isMobile(navigator.userAgent)) {
|
dismissBubble = infoService.display(
|
||||||
// Show the bubble, after a suitable delay (if mouse has
|
"info-table",
|
||||||
// left before this time is up, this will be canceled.)
|
domainObject.getModel().name,
|
||||||
pendingBubble = $timeout(function () {
|
domainObject.useCapability('metadata'),
|
||||||
dismissBubble = infoService.display(
|
mousePosition
|
||||||
"info-table",
|
);
|
||||||
domainObject.getModel().name,
|
element.off('mousemove', trackPosition);
|
||||||
domainObject.useCapability('metadata'),
|
|
||||||
mousePosition
|
pendingBubble = undefined;
|
||||||
);
|
}, DELAY);
|
||||||
element.off('mousemove', trackPosition);
|
|
||||||
|
|
||||||
pendingBubble = undefined;
|
|
||||||
}, DELAY);
|
|
||||||
}
|
|
||||||
element.on('mouseleave', hideBubble);
|
element.on('mouseleave', hideBubble);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Checks if you are on a mobile device, if the device is
|
||||||
// Show bubble (on a timeout) on mouse over
|
// not mobile (queryService.isMobile() = false), then
|
||||||
element.on('mouseenter', showBubble);
|
// the pendingBubble and therefore hovering is allowed
|
||||||
|
if (!queryService.isMobile(navigator.userAgent)) {
|
||||||
|
// Show bubble (on a timeout) on mouse over
|
||||||
|
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
|
||||||
|
Reference in New Issue
Block a user