VRFS-291 VRFS-292 fix issues with Add New Gear popup / minor refactor
This commit is contained in:
parent
e4ebbc4ac4
commit
7cd503cd67
|
|
@ -0,0 +1,30 @@
|
|||
(function(context,$) {
|
||||
|
||||
"use strict";
|
||||
|
||||
context.JK = context.JK || {};
|
||||
context.JK.AddNewGearDialog = function(app) {
|
||||
var logger = context.JK.logger;
|
||||
|
||||
function events() {
|
||||
$('#btn-leave-session-test').click(function() {
|
||||
context.JK.hideOverlay();
|
||||
context.location = "#/ftue1";
|
||||
|
||||
// TODO: THIS IS A HACK - THIS DIALOG IS LAYERED
|
||||
// ON TOP OF OTHER DIALOGS. ANY OTHER DIALOGS THAT
|
||||
// USE THIS NEED TO BE ADDED TO THE FOLLOWING LIST.
|
||||
// NEED TO FIGURE OUT A CLEANER WAY TO HANDLE THIS.
|
||||
$('div[layout-id="add-track"]').hide();
|
||||
$('div[layout-id="configure-audio"]').hide();
|
||||
});
|
||||
}
|
||||
|
||||
this.initialize = function() {
|
||||
events();
|
||||
};
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
})(window,jQuery);
|
||||
|
|
@ -58,6 +58,8 @@
|
|||
|
||||
function events() {
|
||||
|
||||
$('#btn-add-track').unbind("click");
|
||||
|
||||
// Track 2 Add
|
||||
$('#img-add-track2-input-add').click(function() {
|
||||
$('#add-track2-unused > option:selected').remove().appendTo('#add-track2-input');
|
||||
|
|
@ -68,26 +70,14 @@
|
|||
$('#add-track2-input > option:selected').remove().appendTo('#add-track2-unused');
|
||||
});
|
||||
|
||||
$('#btn-cancel-new-audio').click(showOverlay);
|
||||
$('#btn-error-ok').click(showOverlay);
|
||||
$('#btn-cancel-new-audio').click(context.JK.showOverlay);
|
||||
$('#btn-error-ok').click(context.JK.showOverlay);
|
||||
$('#btn-add-track').click(saveSettings);
|
||||
|
||||
$('#btn-leave-session-test').click(function() {
|
||||
$('div[layout-id="add-track"]').hide();
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: figure out how to handle this in layout.js for layered popups
|
||||
function showOverlay() {
|
||||
$('.dialog-overlay').show();
|
||||
}
|
||||
|
||||
function hideOverlay() {
|
||||
$('.dialog-overlay').hide();
|
||||
}
|
||||
|
||||
function showDialog() {
|
||||
|
||||
$('#add-track2-unused').empty();
|
||||
$('#add-track2-input').empty();
|
||||
$('#add-track2-instrument').empty();
|
||||
|
||||
|
|
@ -139,7 +129,7 @@
|
|||
|
||||
$('div[layout-id="add-track"]').hide();
|
||||
|
||||
hideOverlay();
|
||||
context.JK.hideOverlay();
|
||||
|
||||
// refresh Session screen
|
||||
sessionModel.refreshCurrentSession();
|
||||
|
|
|
|||
|
|
@ -220,14 +220,15 @@
|
|||
context.jamClient.TrackOpenControlPanel();
|
||||
});
|
||||
|
||||
$('#btn-cancel-new-audio').click(showOverlay);
|
||||
$('#btn-error-ok').click(showOverlay);
|
||||
$('#btn-cancel-new-audio').click(context.JK.showOverlay);
|
||||
$('#btn-error-ok').click(context.JK.showOverlay);
|
||||
$('#btn-save-settings').click(saveSettings);
|
||||
$('#btn-cancel-settings').click(cancelSettings);
|
||||
|
||||
$('#btn-leave-session-test').click(function() {
|
||||
$('div[layout-id="configure-audio"]').hide();
|
||||
});
|
||||
// $('#btn-leave-session-test').click(function() {
|
||||
// hideOverlay();
|
||||
// $('div[layout-id="configure-audio"]').hide();
|
||||
// });
|
||||
}
|
||||
|
||||
function restoreVoiceChatOptions(deviceId) {
|
||||
|
|
@ -284,10 +285,6 @@
|
|||
$('.dialog-overlay').show();
|
||||
}
|
||||
|
||||
function hideOverlay() {
|
||||
$('.dialog-overlay').hide();
|
||||
}
|
||||
|
||||
function audioDriverChanged() {
|
||||
// ensure any channels removed are restored
|
||||
var keys = Object.keys(removedVoiceChatChannels);
|
||||
|
|
@ -539,7 +536,7 @@
|
|||
originalDeviceId = $('#audio-drivers').val();
|
||||
$('div[layout-id="configure-audio"]').hide();
|
||||
|
||||
hideOverlay();
|
||||
context.JK.hideOverlay();
|
||||
|
||||
// refresh Session screen
|
||||
sessionModel.refreshCurrentSession();
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
var configureTrackDialog;
|
||||
var addTrackDialog;
|
||||
var addNewGearDialog;
|
||||
|
||||
// TODO Consolidate dragged controls and handles
|
||||
var $draggingFaderHandle = null;
|
||||
|
|
@ -114,6 +115,7 @@
|
|||
function _initDialogs() {
|
||||
configureTrackDialog.initialize();
|
||||
addTrackDialog.initialize();
|
||||
addNewGearDialog.initialize();
|
||||
}
|
||||
|
||||
// Get the latest list of underlying audio mixer channels
|
||||
|
|
@ -266,7 +268,7 @@
|
|||
// Show settings icons only for my tracks
|
||||
if (myTrack) {
|
||||
$('div[mixer-id="' + mixer.id + '"].track-icon-settings').show();
|
||||
// myTracks.push(trackData);
|
||||
//myTracks.push(trackData);
|
||||
}
|
||||
// TODO: FIX THIS
|
||||
myTracks.push(trackData);
|
||||
|
|
@ -275,6 +277,7 @@
|
|||
|
||||
configureTrackDialog = new context.JK.ConfigureTrackDialog(app, myTracks, sessionId, sessionModel);
|
||||
addTrackDialog = new context.JK.AddTrackDialog(app, myTracks, sessionId, sessionModel);
|
||||
addNewGearDialog = new context.JK.AddNewGearDialog(app);
|
||||
|
||||
// hide "Add Track" link if there are 2 tracks
|
||||
if (myTracks.length === 2) {
|
||||
|
|
@ -450,7 +453,7 @@
|
|||
|
||||
function deleteTrack(evt) {
|
||||
var trackId = $(evt.currentTarget).attr("track-id");
|
||||
sessionModel.deleteTrack(trackId);
|
||||
sessionModel.deleteTrack(sessionId, trackId);
|
||||
}
|
||||
|
||||
function _toggleVisualMuteControl($control, muting) {
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
function deleteTrack(trackId) {
|
||||
function deleteTrack(sessionId, trackId) {
|
||||
if (trackId) {
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
|
|
|
|||
|
|
@ -85,6 +85,15 @@
|
|||
$('#error-msg', 'div[layout-id="error-dialog"]').html(msg);
|
||||
}
|
||||
|
||||
// TODO: figure out how to handle this in layout.js for layered popups
|
||||
context.JK.showOverlay = function() {
|
||||
$('.dialog-overlay').show();
|
||||
}
|
||||
|
||||
context.JK.hideOverlay = function() {
|
||||
$('.dialog-overlay').hide();
|
||||
}
|
||||
|
||||
/*
|
||||
* Loads a listbox or dropdown with the values in input_array, setting the option value
|
||||
* to the id_field and the option text to text_field. It will preselect the option with
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<br clear="left" /><br />
|
||||
<div class="right">
|
||||
<a id="btn-cancel-new-audio" layout-action="close" class="button-grey">CANCEL</a>
|
||||
<a id="btn-leave-session-test" layout-action="close" href="#/ftue1" class="button-orange">LEAVE SESSION & START TEST</a>
|
||||
<a id="btn-leave-session-test" layout-action="close" class="button-orange">LEAVE SESSION & START TEST</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
|
||||
<!-- my tracks -->
|
||||
<div class="session-mytracks">
|
||||
<h2>my tracks</h2>
|
||||
<h2>my tracks</h2><br />
|
||||
<div id="div-add-track" class="session-add" layout-link="add-track" style="display:block;" mixer-id="{mixerId}">
|
||||
<a>
|
||||
<%= image_tag "content/icon_add.png", {:width => 19, :height => 19, :align => "texttop"} %> Add Track
|
||||
|
|
@ -140,7 +140,6 @@
|
|||
<%= render "addNewGear" %>
|
||||
<%= render "error" %>
|
||||
|
||||
|
||||
<!-- Track Template -->
|
||||
<script type="text/template" id="template-session-track">
|
||||
<div track-id="{trackId}" class="session-track track" client-id="{clientId}">
|
||||
|
|
|
|||
Loading…
Reference in New Issue