* VRFS-797; don't allow the add track handler to be registered > 1 times

This commit is contained in:
Seth Call 2013-10-23 14:59:18 +00:00
parent dcbaf4d329
commit aff6df7028
2 changed files with 10 additions and 2 deletions

View File

@ -409,6 +409,7 @@
}
function closeDialog(dialog) {
console.log("closing dialog: " + dialog);
var $dialog = $('[layout-id="' + dialog + '"]');
dialogEvent(dialog, 'beforeHide');
var $overlay = $('.dialog-overlay');
@ -472,6 +473,7 @@
* also moves the .dialog-overlay such that it hides/obscures all dialogs except the highest one
*/
function stackDialogs($dialog, $overlay) {
console.log("pushing dialog: " + $dialog.attr('layout-id'))
openDialogs.push($dialog);
var zIndex = 1000;
for(var i in openDialogs) {
@ -484,7 +486,11 @@
function unstackDialogs($overlay) {
if(openDialogs.length > 0) {
openDialogs.pop();
var removed = openDialogs.pop();
console.log("removed dialog : " + removed.attr('layout-id'));
}
else {
console.log("no dialog removed because nothing was on the stack");
}
var zIndex = 1000 + openDialogs.length;

View File

@ -440,7 +440,9 @@
addNewGearDialog = new context.JK.AddNewGearDialog(app, ftueCallback);
// # NO LONGER HIDING ADD TRACK even when there are 2 tracks (VRFS-537)
$('#div-add-track').click(function() {
$('#div-add-track').off('click');
$('#div-add-track').on('click', function() {
if (myTracks.length === 2) {
$('#btn-error-ok').click(function() {
app.layout.closeDialog('error-dialog');