From 3c979f0dd467f4f05e25b4da9923b3d066ee9451 Mon Sep 17 00:00:00 2001
From: Lachezar Valchev <lachezar.valchev@ffwagency.com>
Date: Tue, 22 Dec 2015 13:21:14 +0200
Subject: [PATCH] Issue #766924 by lachezar.valchev: Fixed issue with not
 hiding empty tabs.

---
 quicktabs.classes.inc | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/quicktabs.classes.inc b/quicktabs.classes.inc
index 750328c..e83ce7b 100644
--- a/quicktabs.classes.inc
+++ b/quicktabs.classes.inc
@@ -188,7 +188,15 @@ class QuickSet {
       $renderable_contents = 0;
       foreach ($this->contents as $key => $tab) {
         $contents = $tab->render(TRUE);
-        if (empty($contents)) {
+        reset($contents);
+        if (!empty($contents)) {
+          $string = strip_tags($contents['#markup']);
+          $string = trim($string); // If string contain only white spaces it will be removed
+        }
+        else {
+          $string = $contents;
+        }
+        if (!$string) {
           // Rather than removing the item, we set it to NULL. This way we retain
           // the same indices across tabs, so that permanent links to particular
           // tabs can be relied upon.
@@ -532,4 +540,4 @@ class QuickPreRenderedContent implements QuickContentRenderable {
  */
 class InvalidQuickSetException extends Exception {
   
-}
\ No newline at end of file
+}
-- 
2.6.2

