From 0140ba67cb4117f11984d92d16badc8a42032c1c Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 10 Sep 2013 06:14:23 +0000 Subject: [PATCH] fix for VFRS 582 --- app/assets/javascripts/createSession.js | 11 ++++++++++- .../stylesheets/client/screen_common.css.scss | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) 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; }