mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
[Selection] Begin implementing Hover gesture
This commit is contained in:
parent
3228a83802
commit
fd97f4db41
@ -21,16 +21,27 @@
|
||||
*****************************************************************************/
|
||||
|
||||
define(['zepto'], function ($) {
|
||||
function HoverGesture() {
|
||||
function HoverGesture(hoverManager) {
|
||||
this.hoverManager = hoverManager;
|
||||
}
|
||||
|
||||
HoverGesture.prototype.apply = function (htmlElement) {
|
||||
var $element = $(htmlElement);
|
||||
var hoverManager = this.hoverManager;
|
||||
|
||||
function update() {
|
||||
$(hoverManager.all()).removeClass('hovering');
|
||||
$(hoverManager.top()).addClass('hovering');
|
||||
}
|
||||
|
||||
function enter() {
|
||||
hoverManager.add(htmlElement);
|
||||
update();
|
||||
}
|
||||
|
||||
function leave() {
|
||||
hoverManager.remove(htmlElement);
|
||||
update();
|
||||
}
|
||||
|
||||
$element.on('mouseenter', enter);
|
||||
|
Loading…
Reference in New Issue
Block a user