Skip to content

Commit

Permalink
Merge pull request #94 from imarc/mobile-nav-js-fix
Browse files Browse the repository at this point in the history
removed mobile navigation call from plugin.js file
  • Loading branch information
marcelmoreau authored Aug 5, 2017
2 parents 2f876bc + ae38603 commit a343930
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 13 deletions.
15 changes: 8 additions & 7 deletions demo/mobile-navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ <h1>Mobile Navigation</h1>
This component requires the mobileNavigation.plugin.js file.
</p>
<h2>HTML</h2>
<p>The mobile navigation shares similar markup to the desktop navigation. In theory,
you can abstract this mark up into a partial and include the partial within
<p>The mobile navigation shares similar markup to the desktop navigation. In theory,
you can abstract this mark up into a partial and include the partial within
<code>.mobile</code> and <code>.desktop</code> classes.
</p>
<p> This component requires the site to be wrapped in a wrapper class.
<p> This component requires the site to be wrapped in a wrapper class.
By default this is <code>.wrapper</code>.
</p>
<pre>
Expand Down Expand Up @@ -285,11 +285,11 @@ <h2>SCSS</h2>
</pre>
<br />
<h2>JS</h2>
<p>You can have more than one instance of this component. For example, you may
want something for faceted search. Just make sure you change the
<p>You can have more than one instance of this component. For example, you may
want something for faceted search. Just make sure you change the
<code>toggleClass</code> option.</p>
<p>By default, there is an overlay that gets inserted into the DOM by
the library. You can change the css properties for this overlay by altering
<p>By default, there is an overlay that gets inserted into the DOM by
the library. You can change the css properties for this overlay by altering
the <code>overlayCss</code> property.</p>
<br />
<pre>
Expand Down Expand Up @@ -477,6 +477,7 @@ <h2>Plugin Methods</h2>
$(function() {
$('nav.primary').dropdown();
$('.search-drawer').searchDrawer();
$('.mobile').mobileNavigation();
});
</script>
</div>
Expand Down
69 changes: 69 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<img src="img/logo-boilerplate.png" alt="Imarc Boilerplate">
</a>
</div>
<button class="menu-toggle"><i class="fa fa-bars"></i></button>
<div class="desktop">
<div class="utilities">
<nav class="utility">
Expand Down Expand Up @@ -120,6 +121,73 @@ <h3>Lorem Ipsum Dolar Amat</h3>
</ul>
</nav>
</div>
<div class="mobile">
<nav class="primary">
<ul>
<li>
<a href="">Maine</a>
<div class="dropdown">
<ul>
<li><a href="">Augusta</a></li>
<li><a href="">Eliot</a></li>
<li><a href="">Kittery</a></li>
<li><a href="">Portland</a></li>
</ul>
</div>
</li>
<li class="active">
<a href="#yup">Markup</a>
</li>
<li>
<a href="">New Hampshire</a>
<div class="dropdown">
<ul>
<li><a href="">Concord</a></li>
<li><a href="">Manchester</a></li>
<li><a href="">Portsmouth</a>
<div class="dropdown">
<ul>
<li><a href="#">Main Street</a></li>
<li><a href="#">Woodbury Ave</a></li>
</ul>
</div>
</li>
<li><a href="">Hampton</a></li>
</ul>
</div>
</li>
<li>
<a href="">Vermont</a>
<div class="dropdown">
<ul>
<li><a href="">Montpelier</a></li>
<li><a href="">Burlington</a></li>
<li><a href="">Killington</a></li>
<li><a href="">St. Johnsbury</a></li>
</ul>
</div>
</li>
</ul>
</nav>
<div class="utilities">
<nav class="utility">
<ul>
<li><a href="">Careers</a></li>
<li><a href="">Legal</a></li>
<li><a href="">Log In</a></li>
</ul>
</nav>
<form class="search" method="post">
<div class="text">
<label for="search">Search the website</label>
<input id="search" placeholder="Search the website" type="text" />
</div>
<div class="submit">
<input type="submit" value="Search" />
</div>
</form>
</div>
</div>
</div>
</div>
</header>
Expand Down Expand Up @@ -550,6 +618,7 @@ <h3 id="Pseudo-element">Pseudo Element</h3>
$('header.primary.sticky').stickyHeader();
$('.search-drawer').searchDrawer();
$('nav.primary').dropdown();
$('.mobile').mobileNavigation();
});
</script>
</body>
Expand Down
6 changes: 0 additions & 6 deletions js/mobileNavigation.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,3 @@
};

})(jQuery);

$(function() {
// Mobile Navigation
$('.mobile').mobileNavigation();

});

0 comments on commit a343930

Please sign in to comment.