[PATCH conductor] BZ 815783 - fixed checking of launch time params

jprovazn at redhat.com jprovazn at redhat.com
Wed Sep 26 09:38:43 UTC 2012


From: Jan Provaznik <jprovazn at redhat.com>

If there are multiple tabs (=multiple assemblies) on launch time params page,
then checking of empty params doesn't work properly - only params on last tab
are checked.

This patch also fixes CSS for disabled buttons (after consultation with
UI guys).

https://bugzilla.redhat.com/show_bug.cgi?id=815783
---
 src/app/stylesheets/_buttons.scss                      | 8 ++++----
 src/app/views/deployments/launch_time_params.html.haml | 9 +++++----
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/app/stylesheets/_buttons.scss b/src/app/stylesheets/_buttons.scss
index 3f6703b..91055b2 100644
--- a/src/app/stylesheets/_buttons.scss
+++ b/src/app/stylesheets/_buttons.scss
@@ -42,9 +42,9 @@ Application Button Set
     *display: inline;
 }
 
-.button:hover,
-.button:focus,
-.button:active,
+.button:not(.disable):hover,
+.button:not(.disable):focus,
+.button:not(.disable):active,
 .button.active {
     border-color: #3072b3;
     border-bottom-color: #2a65a0;
@@ -58,7 +58,7 @@ Application Button Set
     background-image: linear-gradient(#599bdc, #3072b3);
 }
 
-.button:active,
+.button:not(.disable):active,
 .button.active {
     border-color: #2a65a0;
     border-bottom-color: #3884cd;
diff --git a/src/app/views/deployments/launch_time_params.html.haml b/src/app/views/deployments/launch_time_params.html.haml
index 78cbd69..7d7c80f 100644
--- a/src/app/views/deployments/launch_time_params.html.haml
+++ b/src/app/views/deployments/launch_time_params.html.haml
@@ -47,15 +47,16 @@
 
 :javascript
   function checkEnteredParams() {
-    $('.launch-time-params .parameters').each(function() {
-      var $parameters = $(this).find('.parameter input');
+    var allFilled = _.all($('.launch-time-params .parameters'), function(tab) {
+      var $parameters = $(tab).find('.parameter input');
       var filledOut = _.all($parameters, function(item) {
         return ! _.isEmpty($(item).val());
       });
-      var param_id = $(this).attr('id');
+      var param_id = $(tab).attr('id');
       $('.labels').find('#' + param_id).toggleClass('filled-out', filledOut);
-      $('#submit_params').attr('disabled', !filledOut);
+      return filledOut;
     });
+    $('#submit_params').toggleClass('disable', !allFilled).attr('disabled', !allFilled);
   };
 
   (function () {
-- 
1.7.11.4




More information about the aeolus-devel mailing list