diff --git a/app/assets/javascripts/createSession.js b/app/assets/javascripts/createSession.js index 1173cc6dc..31363bcb8 100644 --- a/app/assets/javascripts/createSession.js +++ b/app/assets/javascripts/createSession.js @@ -216,6 +216,9 @@ console.log("session data=" + jsonData); + $('#btn-create-session').addClass('button-disabled'); + $('#btn-create-session').bind('click', false); + var url = "/api/sessions"; $.ajax({ type: "POST", @@ -232,8 +235,14 @@ // Re-loading the session settings will cause the form to reset with the right stuff in it. // This is an extra xhr call, but it keeps things to a single codepath loadSessionSettings(); + $('#btn-create-session').removeClass('button-disabled'); + $('#btn-create-session').unbind('click', false); }, - error: app.ajaxError + error: function() { + app.ajaxError(arguments); + $('#btn-create-session').removeClass('button-disabled'); + $('#btn-create-session').unbind('click', false); + } }); return false; } diff --git a/app/assets/stylesheets/client/screen_common.css.scss b/app/assets/stylesheets/client/screen_common.css.scss index ec989ff95..8384f6f11 100644 --- a/app/assets/stylesheets/client/screen_common.css.scss +++ b/app/assets/stylesheets/client/screen_common.css.scss @@ -212,6 +212,20 @@ small { text-decoration:none; } +.button-disabled { + border: none; + outline: none; + color:#EEE; + background-color:#666; + cursor:default; + content: "Hang on..." +} + +.button-disabled:hover{ + color:#EEE; + background-color:#666; +} + a img { border:none; }