From e62d7b27f90a969424718d5178864752eeccca91 Mon Sep 17 00:00:00 2001
From: Mark Carver <mark.carver@me.com>
Date: Mon, 17 Feb 2014 01:16:35 -0600
Subject: [PATCH] Issue #2158197 by Mark Carver, ryan.armstrong, trunghaiy |
 csakiistvan: The vertical tab content is missing.

---
 js/misc/_vertical-tabs.js               | 11 ++++++++---
 theme/bootstrap/bootstrap-panel.tpl.php | 34 +++++++++++----------------------
 2 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/js/misc/_vertical-tabs.js b/js/misc/_vertical-tabs.js
index e8588e0..4ee8202 100644
--- a/js/misc/_vertical-tabs.js
+++ b/js/misc/_vertical-tabs.js
@@ -17,6 +17,9 @@ Drupal.behaviors.verticalTabs = {
     $('.vertical-tabs-panes', context).once('vertical-tabs', function () {
       $(this).addClass('tab-content');
       var focusID = $(':hidden.vertical-tabs-active-tab', this).val();
+      if (!focusID.length) {
+        focusID = false;
+      }
       var tab_focus;
 
       // Check if there are some fieldsets that can be converted to vertical-tabs
@@ -41,7 +44,8 @@ Drupal.behaviors.verticalTabs = {
           .addClass('tab-pane vertical-tabs-pane')
           .data('verticalTab', vertical_tab)
           .find('> legend').remove();
-        if (this.id == focusID) {
+        $(this).find('> div').removeClass('panel-collapse collapse').addClass('fade');
+        if (this.id === focusID) {
           tab_focus = $(this);
         }
       });
@@ -108,14 +112,15 @@ Drupal.verticalTab.prototype = {
     this.fieldset
       .siblings('fieldset.vertical-tabs-pane')
         .each(function () {
-          $(this).addClass('fade');
+          $(this).removeClass('active').find('> div').removeClass('in');
           var tab = $(this).data('verticalTab');
           tab.item.removeClass('selected');
         })
         .end()
-        .addClass('fade in')
+        .addClass('active')
         .siblings(':hidden.vertical-tabs-active-tab')
         .val(this.fieldset.attr('id'));
+    this.fieldset.find('> div').addClass('in');
     this.fieldset.data('verticalTab').item.find('a').tab('show');
     this.item.addClass('selected');
     // Mark the active tab for screen readers.
diff --git a/theme/bootstrap/bootstrap-panel.tpl.php b/theme/bootstrap/bootstrap-panel.tpl.php
index e05cdac..d90949e 100644
--- a/theme/bootstrap/bootstrap-panel.tpl.php
+++ b/theme/bootstrap/bootstrap-panel.tpl.php
@@ -7,40 +7,28 @@
  */
 
 ?>
-<?php if ($prefix): ?>
-  <?php print $prefix; ?>
-<?php endif; ?>
+<?php if ($prefix): print $prefix; endif ?>
 <fieldset <?php print $attributes; ?>>
   <?php if ($title): ?>
     <?php if ($collapsible): ?>
-      <legend class="panel-heading">
-        <a href="#<?php print $id; ?>" class="panel-title fieldset-legend" data-toggle="collapse">
-          <?php print $title; ?>
-        </a>
-      </legend>
+    <legend class="panel-heading">
+      <a href="#<?php print $id; ?>" class="panel-title fieldset-legend" data-toggle="collapse"><?php print $title; ?></a>
+    </legend>
     <?php else: ?>
-      <legend class="panel-heading">
-        <div class="panel-title fieldset-legend">
-          <?php print $title; ?>
-        </div>
-      </legend>
+    <legend class="panel-heading">
+      <div class="panel-title fieldset-legend"><?php print $title; ?></div>
+    </legend>
     <?php endif; ?>
   <?php endif; ?>
   <?php if ($collapsible): ?>
-    <div id="<?php print $id; ?>" class="panel-collapse collapse fade<?php print (!$collapsed ? ' in' : ''); ?>">
+  <div id="<?php print $id; ?>" class="panel-collapse collapse fade<?php print (!$collapsed ? ' in' : ''); ?>">
   <?php endif; ?>
   <div class="panel-body">
-    <?php if ($description): ?>
-      <p class="help-block">
-        <?php print $description; ?>
-      </p>
-    <?php endif; ?>
+    <?php if ($description): ?><div class="help-block"><?php print $description; ?></div><?php endif; ?>
     <?php print $content; ?>
   </div>
   <?php if ($collapsible): ?>
-    </div>
+  </div>
   <?php endif; ?>
 </fieldset>
-<?php if ($suffix): ?>
-  <?php print $suffix; ?>
-<?php endif; ?>
+<?php if ($suffix): print $suffix; endif ?>
-- 
1.8.5.3

