* VRFS-2368 - close prodBubbles on session transition, open dialog, close dialog

This commit is contained in:
Seth Call 2014-10-25 10:04:28 -05:00
parent 48dea5688e
commit dc590a95c2
4 changed files with 19 additions and 2 deletions

View File

@ -93,7 +93,7 @@
var profiles = populateAccountAudio();
if(profiles.length <= 1) {
setTimeout(function() {
context.JK.prodBubble($addNewGearBtn, 'no-audio-profiles', {}, {positions: ['bottom'], offsetParent: $addNewGearBtn.closest('.screen')});
context.JK.prodBubble($addNewGearBtn, 'no-audio-profiles', {}, {positions: ['bottom'], offsetParent: $addNewGearBtn.closest('.screen')})
}, 1000);
}

View File

@ -462,6 +462,7 @@
$dialog.triggerHandler(EVENTS.DIALOG_CLOSED, {name: dialog, dialogCount: openDialogs.length, result: $dialog.data('result'), canceled: canceled });
$(context).triggerHandler(EVENTS.DIALOG_CLOSED, {name: dialog, dialogCount: openDialogs.length, result: $dialog.data('result'), canceled: canceled });
dialogEvent(dialog, 'afterHide');
$.btOffAll(); // add any prod bubbles if you close a dialog
}
function screenEvent(screen, evtName, data) {
@ -568,6 +569,8 @@
screenEvent(previousScreen, 'afterHide', data);
screenEvent(currentScreen, 'afterShow', data);
console.log("$", $.btOffAll)
jQuery.btOffAll(); // add any prod bubbles if you change screens
// Show any requested dialog
if ("d" in data) {
@ -700,6 +703,7 @@
addScreenContextToDialog($dialog)
$dialog.show();
dialogEvent(dialog, 'afterShow', options);
$.btOffAll(); // add any prod bubbles if you open a dailog
return $dialog;
}

View File

@ -198,6 +198,7 @@
$element.btOff();
}
})
return $element;
}
/**
* Associates a bubble on hover (by default) with the specified $element, using jquery.bt.js (BeautyTips)

View File

@ -709,6 +709,9 @@ jQuery.bt = {version: '0.9.7'};
jQuery.bt.vars.closeWhenOpenStack.push(this);
}
// MSC: track all bt's open
jQuery.bt.vars.allOpenStack.push(this);
// trigger postShow function
// function receives the box element (the balloon wrapper div) as an argument
opts.postShow.apply(this, [$box[0]]);
@ -747,6 +750,8 @@ jQuery.bt = {version: '0.9.7'};
// remove this from the stacks
jQuery.bt.vars.clickAnywhereStack = arrayRemove(jQuery.bt.vars.clickAnywhereStack, i);
jQuery.bt.vars.closeWhenOpenStack = arrayRemove(jQuery.bt.vars.closeWhenOpenStack, i);
// MSC: track all bt's open
jQuery.bt.vars.allOpenStack = arrayRemove(jQuery.bt.vars.allOpenStack, i);
// remove the 'bt-active' and activeClass classes from target
$(i).removeClass('bt-active ' + opts.activeClass);
@ -1069,7 +1074,14 @@ jQuery.bt = {version: '0.9.7'};
});
}; // </ $().btOff() >
jQuery.bt.vars = {clickAnywhereStack: [], closeWhenOpenStack: []};
/**
* Turn off all open beauty tips
*/
jQuery.btOffAll = function() {
$(jQuery.bt.vars.allOpenStack).btOff();
}
jQuery.bt.vars = {clickAnywhereStack: [], closeWhenOpenStack: [], allOpenStack: []};
/**
* This function gets bound to the document's click event