You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2015/02/12 14:35:59 UTC

svn commit: r1659250 - in /myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main: java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/

Author: lofwyr
Date: Thu Feb 12 13:35:58 2015
New Revision: 1659250

URL: http://svn.apache.org/r1659250
Log:
TOBAGO-1368: Create a new theme which uses Bootstrap
- markup active tab

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java?rev=1659250&r1=1659249&r2=1659250&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java Thu Feb 12 13:35:58 2015
@@ -203,7 +203,12 @@ public class TabGroupRenderer extends La
             ComponentUtils.addCurrentMarkup(tab, ComponentUtils.markupOfSeverity(maxSeverity));
           }
           writer.startElement(HtmlElements.LI, tab);
-          writer.writeClassAttribute(Classes.create(tab));
+          // todo: fix Css management
+          if (activeIndex == index) {
+            writer.writeClassAttribute(Classes.create(tab).getStringValue() + " " + BootstrapClass.ACTIVE.getName());
+          } else {
+            writer.writeClassAttribute(Classes.create(tab));
+          }
           writer.writeAttribute(HtmlAttributes.ROLE, HtmlRoleValues.PRESENTATION.toString(), false);
           writer.writeAttribute(HtmlAttributes.TABGROUPINDEX, index);
           final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, tab);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js?rev=1659250&r1=1659249&r2=1659250&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js Thu Feb 12 13:35:58 2015
@@ -31,8 +31,9 @@ Tobago.TabGroup.init = function(elements
     jQuery(this).find(".tobago-tabGroup-headerInner").first()
       .children(".tobago-tab").not(".tobago-tab-markup-disabled").click(function() {
           var activeIndex = Tobago.TabGroup.updateHidden(jQuery(this));
-          jQuery(this).siblings(".tobago-tab-markup-selected").removeClass("tobago-tab-markup-selected");
-          jQuery(this).addClass("tobago-tab-markup-selected");
+          jQuery(this).siblings(".tobago-tab-markup-selected").removeClass("tobago-tab-markup-selected")
+              .removeClass("active"); // "active" is bootstrap
+          jQuery(this).addClass("tobago-tab-markup-selected").addClass("active"); // "active" is bootstrap
           var tabGroup = jQuery(this).parents(".tobago-tabGroup:first");
           tabGroup.children(".tobago-tab-content-markup-selected").removeClass("tobago-tab-content-markup-selected");
           tabGroup.children(".tobago-tab-content[tabgroupindex=" + activeIndex + "]")