* VRFS-2806 - disallow concurrent open of dialog

This commit is contained in:
Seth Call 2015-02-20 09:50:03 -06:00
parent 7493726e14
commit 9d70400e91
1 changed files with 20 additions and 9 deletions

View File

@ -94,6 +94,7 @@
var $mixModeDropdown = null;
var $templateMixerModeChange = null;
var $closePlaybackRecording = null;
var $openBackingTrack = null;
var mediaTrackGroups = [ChannelGroupIds.MediaTrackGroup, ChannelGroupIds.JamTrackGroup, ChannelGroupIds.MetronomeGroup];
var rest = context.JK.Rest();
@ -139,6 +140,8 @@
function afterShow(data) {
$openBackingTrack.removeClass('disabled');
if(!context.JK.JamServer.connected) {
promptLeave = false;
app.notifyAlert("Not Connected", 'To create or join a session, you must be connected to the server.');
@ -1925,6 +1928,13 @@
}
function handleBackingTrackSelectedCallback(result) {
$openBackingTrack.removeClass('disabled');
if(!sessionModel.inSession()) {
return;
}
if(result.success) {
logger.debug("backing track selected: " + result.file);
@ -1937,8 +1947,6 @@
.fail(function(jqXHR) {
app.notifyServerError(jqXHR, "Unable to Open BackingTrack For Playback");
})
}
else {
logger.debug("no backing track selected")
@ -2286,6 +2294,12 @@
}
function openBackingTrack(e) {
if($openBackingTrack.is('.disabled')) {
logger.debug("backing track dialog already open")
return false;
}
// just ignore the click if they are currently recording for now
if(sessionModel.recordingModel.isRecording()) {
app.notify({
@ -2296,13 +2310,8 @@
return false;
}
$openBackingTrack.addClass('disabled');
context.jamClient.ShowSelectBackingTrackDialog("window.JK.HandleBackingTrackSelectedCallback");
//app.layout.showDialog('open-backing-track-dialog').one(EVENTS.DIALOG_CLOSED, function(e, data) {
// if(!data.cancel && data.result){
// sessionModel.setBackingTrack(data.result);
// }
//})
return false;
}
@ -2323,6 +2332,7 @@
}
function openBackingTrackFile(e) {
// just ignore the click if they are currently recording for now
if(sessionModel.recordingModel.isRecording()) {
app.notify({
@ -2611,7 +2621,7 @@
$('#recording-start-stop').on('click', startStopRecording);
$('#open-a-recording').on('click', openRecording);
$('#open-a-jamtrack').on('click', openJamTrack);
$('#open-a-backingtrack').on('click', openBackingTrack);
$openBackingTrack.on('click', openBackingTrack);
$('#open-a-metronome').on('click', openMetronome);
$('#session-invite-musicians').on('click', inviteMusicians);
$('#session-invite-musicians2').on('click', inviteMusicians);
@ -2656,6 +2666,7 @@
$mixModeDropdown = $screen.find('select.monitor-mode')
$templateMixerModeChange = $('#template-mixer-mode-change');
$closePlaybackRecording = $('#close-playback-recording')
$openBackingTrack = $('#open-a-backingtrack');
events();