Skip to content

Commit

Permalink
GTNPORTAL-3412 HTML5 data-* attributes not compatible with XHTML 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasponce authored and ppalaga committed Mar 21, 2014
1 parent 590f437 commit ea597c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
13 changes: 9 additions & 4 deletions mobile-integration/portlets/header/src/main/webapp/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
$(".gtnResponsiveMenuCollapseButton").each(function(){

$(this).click(function(){
if ($(this).data("target") && $(this).data("target-class") && $(this).data("action") == "toggleCSS")
var dataTarget = $(this).children(".data.target").first();
var dataTargetClass = $(this).children(".data.target.class").first();
var dataAction = $(this).children(".data.action").first();
var dataSelfClass = $(this).children(".data.self.class").first();

if (dataTarget && dataTargetClass && dataAction.val() == "toggleCSS")
{
$($(this).data("target")).toggleClass($(this).data("target-class"));
$(dataTarget.val()).toggleClass(dataTargetClass.val());
}

if ($(this).data("self-class") && $(this).data("action") == "toggleCSS")
if (dataSelfClass && dataAction.val() == "toggleCSS")
{
$(this).toggleClass($(this).data("self-class"));
$(this).toggleClass(dataSelfClass.val());
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ jsMan.require("SHARED/org_gatein_responsive_menu", "menu").addScripts("menu.init
<div id="<portlet:namespace/>_gtnResponsiveHeaderPortlet" class="gtnResponsiveHeaderPortlet">
<div class="collapsibleRow clearfix">
<div id="<portlet:namespace/>_logo" class="logo" onclick="window.location = '${homePageLink}';"><span class="skipHidden">GateIn</span></div>
<div id="<portlet:namespace/>_icon" class="gtnResponsiveMenuCollapseButton"
data-target="#<portlet:namespace/>_options" data-action="toggleCSS" data-target-class="display"
data-self-class="enabled"><div class="collapseButtonIcon" title="${resourceBundle.getString('label.ShowGroupPages')}"></div>
<div id="<portlet:namespace/>_icon" class="gtnResponsiveMenuCollapseButton">
<input type="hidden" class="data target" value="#<portlet:namespace/>_options" />
<input type="hidden" class="data action" value="toggleCSS" />
<input type="hidden" class="data target class" value="display" />
<input type="hidden" class="data self class" value="enabled" />
<div class="collapseButtonIcon" title="${resourceBundle.getString('label.ShowGroupPages')}"></div>
</div>
<div id="<portlet:namespace/>_options" class="gtnResponsiveMenu options collapsibleContent collapsibleRow">
<ol class="menu">
Expand Down

0 comments on commit ea597c1

Please sign in to comment.