You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by as...@apache.org on 2014/03/04 09:15:14 UTC

svn commit: r1573926 - in /bloodhound/trunk/bloodhound_theme/bhtheme/htdocs: bloodhound.css js/theme.js

Author: asemonella
Date: Tue Mar  4 08:15:13 2014
New Revision: 1573926

URL: http://svn.apache.org/r1573926
Log:
#727 Disable "More fields" link instead of hiding
when no product selected.

Modified:
    bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css
    bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js

Modified: bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css?rev=1573926&r1=1573925&r2=1573926&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css (original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css Tue Mar  4 08:15:13 2014
@@ -342,8 +342,10 @@ ol.arabic     { list-style-type: decimal
  margin-top: 5px;
  margin-bottom: 5px;
 }
-#qct-more {
- visibility: hidden;
+#qct-more.disabled {
+ text-decoration: none;
+ background-color: #fff;
+ color: #333;
 }
 
 /*

Modified: bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js?rev=1573926&r1=1573925&r2=1573926&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js (original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js Tue Mar  4 08:15:13 2014
@@ -97,7 +97,7 @@ $(function() {
   /**
    * POST QCT form fields to full ticket form when "More fields" is clicked
    */
-  $('#qct-more').click(function(e) {
+  function post_qct_more(e) {
     // As we're not creating the ticket, we'll remove hidden fields
     // that result in unnecessary validation messages.
     e.preventDefault();
@@ -109,21 +109,28 @@ $(function() {
     $qct_form.append('<input type="hidden" value="1" name="preview" />');
     $qct_form.submit();
 
-  });
+  };
 
-  function set_qct_more_visibility(is_visible) {
-    if (is_visible) {
-      $('#qct-more').css('visibility', 'visible');
+  function set_qct_more_enabled(is_enabled) {
+    var qct_more = $('#qct-more');
+    qct_more.unbind('click');
+    if (is_enabled) {
+      qct_more.removeClass('disabled');
+      qct_more.click(post_qct_more);
     } else {
-      $('#qct-more').css('visibility', 'hidden');
+      qct_more.addClass('disabled');
+      qct_more.click(function(e) {
+        e.preventDefault();
+        e.stopPropagation(); // keep #qct-form open
+      });
     }
   }
 
   $('#field-product').change(function(e) {
-    set_qct_more_visibility($(this).val());
+    set_qct_more_enabled($(this).val());
   });
 
-  set_qct_more_visibility($('#field-product').val());
+  set_qct_more_enabled($('#field-product').val());
 
   $('body').on('click.close', '#qct-alert-close',
       function(e) {