Skip to content

Commit

Permalink
Move topbar breakpoint config to nav element data-breakpoint attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Humphreys committed Sep 18, 2012
1 parent d3b9b4a commit 7137183
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/topbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<!-- <div class="row">
<div class="six columns"> -->
<nav class="top-bar contain-to-grid"> <!-- Could do .fixed to fix to top or .contain-to-grid for grid width -->
<nav class="top-bar contain-to-grid" data-breakpoint="940"> <!-- Could do .fixed to fix to top or .contain-to-grid for grid width -->
<ul>
<!-- Title Area -->
<li class="name">
Expand Down
10 changes: 6 additions & 4 deletions vendor/assets/javascripts/foundation/jquery.foundation.topbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

var settings = {
index : 0,
breakPoint : 940, // Set to to 9999 to force it into responsive always
breakPoint : 767,
initialized : false
},
methods = {
Expand All @@ -23,6 +23,7 @@
settings.$w = $(window),
settings.$topbar = $('nav.top-bar');
settings.$titlebar = settings.$topbar.children('ul:first');
settings.breakPoint = settings.$topbar.data('breakpoint') || settings.breakPoint;

if (!settings.initialized) {
methods.assemble();
Expand All @@ -36,9 +37,10 @@
$('.top-bar .toggle-topbar').live('click.fndtn', function (e) {
e.preventDefault();

settings.$topbar.toggleClass('expanded');
settings.$topbar.css('min-height', '');

if (methods.breakpoint()) {
settings.$topbar.toggleClass('expanded');
settings.$topbar.css('min-height', '');
}
});

// Show the Dropdown Levels on Click
Expand Down

0 comments on commit 7137183

Please sign in to comment.