diff --git a/app/assets/javascripts/createSession.js b/app/assets/javascripts/createSession.js index 2be68dddb..522da0f23 100644 --- a/app/assets/javascripts/createSession.js +++ b/app/assets/javascripts/createSession.js @@ -114,13 +114,15 @@ Message from Seth on sequence for creating/joining sessions: } var $this = $(this); var data = $this.formToObject(); - data.musician_access = Boolean(data.musician_access); data.client_id = app.clientId; if (typeof(data.genres) === "string") { data.genres = [data.genres]; } - // FIXME: Hard-code tracks for now. Needs to be pickable + // FIXME: Hard-code tracks for now. Needs to default to: + // 1. If no previous session data, a single stereo track with the + // top instrument in the user's profile. + // 2. Otherwise, use the tracks from the last created session. data.tracks = [ { instrument_id: "electric guitar", sound: "mono" }, { instrument_id: "keyboard", sound: "mono" } @@ -148,15 +150,15 @@ Message from Seth on sequence for creating/joining sessions: contentType: 'application/json', url: url, processData:false, - data: JSON.stringify(data) - }).done( - function(response) { + data: JSON.stringify(data), + success: function(response) { var newSessionId = response.id; createInvitations(newSessionId, function() { self.location = '#/session/' + newSessionId; }); - } - ).fail(app.ajaxError); + }, + error: app.ajaxError + }); return false; } diff --git a/app/assets/javascripts/jamkazam.js b/app/assets/javascripts/jamkazam.js index 4d1b64464..50c21cca8 100644 --- a/app/assets/javascripts/jamkazam.js +++ b/app/assets/javascripts/jamkazam.js @@ -84,7 +84,7 @@ * Generic error handler for Ajax calls. */ function ajaxError(jqXHR, textStatus, errorMessage) { - notify({title: textStatus, text: errorMessage, detail: jqXHR.responseText}); + app.notify({title: textStatus, text: errorMessage, detail: jqXHR.responseText}); } /** diff --git a/app/assets/javascripts/layout.js b/app/assets/javascripts/layout.js index 6f631af8b..4e07b5afd 100644 --- a/app/assets/javascripts/layout.js +++ b/app/assets/javascripts/layout.js @@ -455,8 +455,6 @@ this.initialize = function(inOpts) { me = this; opts = $.extend(opts, inOpts); - logger.error("layout.initialize.opts:"); - logger.error(opts); setup(); events(); }; diff --git a/app/views/clients/_createSession.html.erb b/app/views/clients/_createSession.html.erb index 32dcd57f5..027c5c506 100644 --- a/app/views/clients/_createSession.html.erb +++ b/app/views/clients/_createSession.html.erb @@ -19,14 +19,42 @@ + + -->