]> iEval git - gruntmaster-page.git/commitdiff
Collapse nav on mobile devices
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 8 Apr 2015 17:20:45 +0000 (20:20 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 8 Apr 2015 17:29:20 +0000 (20:29 +0300)
MANIFEST
js/90-mobilenav.js [new file with mode: 0644]
tmpl/skel.en

index 8c47140035f488e8cdf70fc8e2e3155b81ab8686..45609fffcd6ca21124a475a3f95a0b1628de91e7 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -18,6 +18,7 @@ js/20-sprintf.js
 js/80-sidebar.js
 js/90-divine-format.js
 js/90-form.js
 js/80-sidebar.js
 js/90-divine-format.js
 js/90-form.js
+js/90-mobilenav.js
 js/90-nav.js
 js/90-reqjs.js
 js/90-themes.js
 js/90-nav.js
 js/90-reqjs.js
 js/90-themes.js
diff --git a/js/90-mobilenav.js b/js/90-mobilenav.js
new file mode 100644 (file)
index 0000000..d12e0fa
--- /dev/null
@@ -0,0 +1,13 @@
+(function(){
+       'use strict';
+
+       $( document ).ready(function(){
+               if(document.body.clientWidth >= 768)
+                       return;
+               $('#title').before('<div class="text-center">Tap title to toggle menu</div>');
+               $('nav').addClass('hidden');
+               $('#title').css('margin', '6px').on('click', function () {
+                       $('nav').toggleClass('hidden');
+               });
+       });
+})();
index 22411f95583d5c67a91c5ea2aec31a4021fb40aa..82e6a13123eb3e0a3526d60d545cb584dad42c37 100644 (file)
@@ -9,8 +9,8 @@
 <script src="/static/js.js" type="text/javascript" async defer></script>
 
 <body>
 <script src="/static/js.js" type="text/javascript" async defer></script>
 
 <body>
-<nav role="navigation">
 <div class="container-fluid">
 <div class="container-fluid">
+<nav role="navigation">
 <ul class="nav nav-pills nav-justified">
 <li id="nav-home"><a href="/">Gruntmaster 6000</a>
 <li id="nav-pb"><a href="/pb/">Problems</a>
 <ul class="nav nav-pills nav-justified">
 <li id="nav-home"><a href="/">Gruntmaster 6000</a>
 <li id="nav-pb"><a href="/pb/">Problems</a>
 <li id="nav-contribute"><a href="/contribute">Contribute!</a>
 
 </ul>
 <li id="nav-contribute"><a href="/contribute">Contribute!</a>
 
 </ul>
-</div>
 </nav>
 
 </nav>
 
-<div class="container-fluid">
-
 <h1 id="title">TITLE</h1>
 <div id="static" class="alert alert-info" static="yes">This is a static version of Gruntmaster 6000.</div>
 
 <h1 id="title">TITLE</h1>
 <div id="static" class="alert alert-info" static="yes">This is a static version of Gruntmaster 6000.</div>
 
This page took 0.029273 seconds and 4 git commands to generate.