* VRFS-2097 - move around hover hookups

This commit is contained in:
Seth Call 2014-11-16 21:40:21 -06:00
parent f27673eb31
commit 6b5cd42432
6 changed files with 21 additions and 16 deletions

View File

@ -9,7 +9,7 @@
this.showBubble = function($hoverElement) {
rest.getBand(bandId)
return rest.getBand(bandId)
.done(function(response) {
$(hoverSelector).html('');

View File

@ -10,7 +10,7 @@
this.showBubble = function($hoverElement) {
rest.getUserDetail({id: userId})
return rest.getUserDetail({id: userId})
.done(function(response) {
$(hoverSelector).html('');

View File

@ -13,7 +13,7 @@
this.showBubble = function($hoverElement) {
$templateLatency = $("#template-account-session-latency");
rest.getUserDetail({id: userId})
return rest.getUserDetail({id: userId})
.done(function(response) {
$(hoverSelector).html('');

View File

@ -39,7 +39,7 @@
this.showBubble = function($hoverElement) {
rest.getClaimedRecording(recordingId)
return rest.getClaimedRecording(recordingId)
.done(function(response) {
var claimedRecording = response;
var recording = response.recording;

View File

@ -10,7 +10,7 @@
this.showBubble = function($hoverElement) {
rest.getSessionHistory(sessionId)
return rest.getSessionHistory(sessionId)
.done(function(response) {
$(hoverSelector).html('');

View File

@ -333,23 +333,26 @@
function showBubble(bubble, $hoverElement) {
$hoverElement.attr("bubble-id", bubble.id);
bubble.showBubble($hoverElement);
bubble.showBubble($hoverElement)
.done(function() {
$(bubble.id()).hover(
function () {
$(this).data('hovering', true)
// do nothing when entering the bubble
},
function () {
$(this).data('hovering', false).fadeOut(100);
}
);
})
}
function hideBubble($hoverElement) {
var bubbleSelector = $hoverElement.attr("bubble-id");
$(bubbleSelector).hover(
function () {
$(this).data('hovering', true)
// do nothing when entering the bubble
},
function () {
$(this).data('hovering', false).fadeOut(fadeoutValue);
}
);
// first check to see if the user isn't hovering over the hover bubble
if (!$(bubbleSelector).data('hovering')) {
$(bubbleSelector).fadeOut(fadeoutValue);
@ -360,8 +363,10 @@
$("[hoveraction='musician']", $parent).hoverIntent({
over: function(e) {
var bubble = new JK.MusicianHoverBubble($(this).attr('user-id'), e.pageX, e.pageY);
showBubble(bubble, $(this));
},
out: function () { // this registers for leaving the hoverable element
hideBubble($(this));