From f3f57928b0b8ff5e342f9417323a1592bc2ca945 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 8 Apr 2015 20:20:45 +0300 Subject: [PATCH] Collapse nav on mobile devices --- MANIFEST | 1 + js/90-mobilenav.js | 13 +++++++++++++ tmpl/skel.en | 5 +---- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 js/90-mobilenav.js diff --git a/MANIFEST b/MANIFEST index 8c47140..45609ff 100644 --- 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/90-mobilenav.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 index 0000000..d12e0fa --- /dev/null +++ b/js/90-mobilenav.js @@ -0,0 +1,13 @@ +(function(){ + 'use strict'; + + $( document ).ready(function(){ + if(document.body.clientWidth >= 768) + return; + $('#title').before('
Tap title to toggle menu
'); + $('nav').addClass('hidden'); + $('#title').css('margin', '6px').on('click', function () { + $('nav').toggleClass('hidden'); + }); + }); +})(); diff --git a/tmpl/skel.en b/tmpl/skel.en index 22411f9..82e6a13 100644 --- a/tmpl/skel.en +++ b/tmpl/skel.en @@ -9,8 +9,8 @@ - -
-

TITLE

This is a static version of Gruntmaster 6000.
-- 2.39.2