#534680 by dagmar: Visual indicator if checkbox will expand options.
authorEarl Miles
Tue, 15 Sep 2009 17:32:20 +0000 (17:32 +0000)
committerEarl Miles
Tue, 15 Sep 2009 17:32:20 +0000 (17:32 +0000)
CHANGELOG.txt
css/views-admin.css
images/expanded-options.png [new file with mode: 0644]
js/dependent.js

index 268d4a1..e3d082f 100644 (file)
@@ -50,6 +50,7 @@ Views 2.x-dev
     o #523580 by JirkaRybka: More documentation on Reduce Duplicates option.
     o #510920 by apanag: Add set_current_page() method to view class.
     o #337741 by joachim: Allow profile fields to have "link to user" option.
+    o #534680 by dagmar: Visual indicator if checkbox will expand options.
 
 Views 2.6
   Bugs fixed:
index d705f40..8d9fe45 100644 (file)
@@ -386,6 +386,22 @@ html.js #views-ajax-pad {
   margin: 0;
 }
 
+#views-ajax-pad label.hidden-options {
+  background: transparent url(../images/arrow-active.png) no-repeat right;
+  height: 12px;
+  padding-right: 12px;
+}
+
+#views-ajax-pad label.expanded-options {
+  background: transparent url(../images/expanded-options.png) no-repeat right;
+  height: 12px;
+  padding-right: 16px;
+}
+
+#views-ajax-pad .dependent-options {
+  padding-left: 30px;
+}
+
 /*
  * Add, Rearrange and Configure buttons using sprites
  */
diff --git a/images/expanded-options.png b/images/expanded-options.png
new file mode 100644 (file)
index 0000000..b7b755c
Binary files /dev/null and b/images/expanded-options.png differ
index 3755f63..d021eef 100644 (file)
@@ -81,6 +81,9 @@ Drupal.Views.dependent.autoAttach = function() {
 
       Drupal.Views.dependent.activeTriggers.push(trigger_id);
 
+      if (jQuery(trigger_id).attr('type') == 'checkbox') {
+        $(trigger_id).parent().addClass('hidden-options');
+      }
 
       var getValue = function(item, trigger) {
         if (item.substring(0, 6) == 'radio:') {
@@ -90,6 +93,14 @@ Drupal.Views.dependent.autoAttach = function() {
           switch (jQuery(trigger).attr('type')) {
             case 'checkbox':
               var val = jQuery(trigger).attr('checked') || 0;
+              
+              if (val) {
+                $(trigger).parent().removeClass('hidden-options').addClass('expanded-options');
+              }
+              else {
+                $(trigger).parent().removeClass('expanded-options').addClass('hidden-options');
+              }
+              
               break;
             default:
               var val = jQuery(trigger).val();
@@ -137,6 +148,7 @@ Drupal.Views.dependent.autoAttach = function() {
             if (Drupal.settings.viewsAjax.formRelationships[id].num <= len) {
               // Show if the element if criteria is matched
               object.show(0);
+              object.addClass('dependent-options');
             }
             else {
               // Otherwise hide