changeset 2129:e93d909f2ea0

Tweak common.js for Bootstrap support in user settings.
author Andreas Kloeckner <inform@tiker.net>
date Tue, 02 Apr 2013 00:54:02 -0400
parents 1d8366403411
children e71b23c993c8
files MoinMoin/templates/common.js
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/templates/common.js	Tue Apr 02 00:39:37 2013 +0200
+++ b/MoinMoin/templates/common.js	Tue Apr 02 00:54:02 2013 -0400
@@ -325,9 +325,10 @@
     if ($('#moin-usersettings').length === 0) { return; }
 
     // create a UL that will be displayed as row of tabs or column of buttons
+    // "nav nav-tabs" for Bootstrap compatibility.
     $(function () {
         var tabs = $('#moin-usersettings'),
-            titles = $('<ul class="moin-tab-titles">');
+            titles = $('<ul class="moin-tab-titles nav nav-tabs">');
         // for each form on page, create a corresponding LI
         $('.moin-tab-body').each(function () {
             var li = $(document.createElement('li')),
@@ -338,6 +339,10 @@
             // add click handler to show this form and hide all others
             aTagClone.click(function (ev) {
                 var tab = this.hash;
+                // parent() active for Bootstrap compatibility
+                $('.moin-current-tab').parent().removeClass('active');
+                $(ev.target).parent().addClass('active');
+
                 $('.moin-current-tab').removeClass('moin-current-tab');
                 $(ev.target).addClass('moin-current-tab');
                 tabs.children('.moin-tab-body').hide().removeClass('moin-current-form');