From 10d98e5bf4d20ab9f96b0db0cd3250ccaf46c1ef Mon Sep 17 00:00:00 2001
Message-Id: <10d98e5bf4d20ab9f96b0db0cd3250ccaf46c1ef.1344746738.git.dmitriy.trt@gmail.com>
From: "Dmitriy.trt" <dmitriy.trt@gmail.com>
Date: Sun, 12 Aug 2012 11:45:34 +0700
Subject: [PATCH] Issue #1724522: Add classes to the filter wrapper on hidden
 elements

---
 better_formats.module |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/better_formats.module b/better_formats.module
index 8cfd34f..648b150 100644
--- a/better_formats.module
+++ b/better_formats.module
@@ -201,6 +201,18 @@ function better_formats_filter_process_format($element) {
   // anything inside it.
   if (!$show_selection && !$show_tips && !$show_tips_link) {
     $element['format']['#type'] = 'container';
+    $element['format']['#attributes']['class'][] = 'bf-all-hidden';
+  }
+  else {
+    if (!$show_selection) {
+      $element['format']['#attributes']['class'][] = 'bf-no-selection';
+    }
+    if (!$show_tips) {
+      $element['format']['#attributes']['class'][] = 'bf-no-tips';
+    }
+    if (!$show_tips_link) {
+      $element['format']['#attributes']['class'][] = 'bf-no-tips-link';
+    }
   }
 
   return $element;
-- 
1.7.10.4

