// mobile nav
This commit is contained in:
1 parent
42af175d22
commit
b214ea68ff
6 files changed
+5949
-34
No files matched your search
@@ -5,7 +5,7 @@ sass_dir = "scss"
|
|||||||
images_dir = "img"
|
images_dir = "img"
|
||||||
javascripts_dir = "js"
|
javascripts_dir = "js"
|
||||||
fonts_dir = "font"
|
fonts_dir = "font"
|
||||||
output_style = :compressed
|
output_style = :compact
|
||||||
environment = :production
|
environment = :production
|
||||||
|
|
||||||
# To enable relative paths to assets via compass helper functions. Uncomment:
|
# To enable relative paths to assets via compass helper functions. Uncomment:
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -100,47 +100,64 @@ $( document ).ready(function() {
|
|||||||
|
|
||||||
function mobileNav() {
|
function mobileNav() {
|
||||||
//clean actual menu type
|
//clean actual menu type
|
||||||
$('body').removeClass('page-sidebar').removeClass('page-topbar').removeClass('page-sidebar-closed');
|
//$('body').removeClass('page-sidebar').removeClass('page-topbar').removeClass('page-sidebar-closed');
|
||||||
// get it in navigation whatever type it is.
|
// get it in navigation whatever type it is.
|
||||||
var navigation = $('#nav-sidebar,#nav-topbar');
|
var navigation = $('#nav-sidebar,#nav-topbar');
|
||||||
var submenu = "";
|
var submenu = "";
|
||||||
// clean trigger
|
// clean trigger
|
||||||
navigation.off().attr('id','nav-mobile');
|
navigation.off().attr('id','nav-mobile');
|
||||||
$('span.menu-collapse').off();
|
$('span.menu-collapse').off();
|
||||||
navigation.on('click','span.menu-collapse',function(){
|
navigation.on('click.collapse','span.menu-collapse',function(){
|
||||||
if ($(this).hasClass('expanded')){
|
if ($(this).hasClass('expanded')){
|
||||||
$(this).html('<i class="icon-align-justify"></i>');
|
$(this).html('<i class="icon-align-justify"></i>');
|
||||||
navigation.find('ul.menu').hide();
|
navigation.find('ul.menu').hide();
|
||||||
|
navigation.removeClass('expanded');
|
||||||
$(this).removeClass('expanded');
|
$(this).removeClass('expanded');
|
||||||
|
//remove submenu when closing nav
|
||||||
|
$('#nav-mobile-submenu').remove();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$(this).html('<i class="icon-remove"></i>');
|
$(this).html('<i class="icon-remove"></i>');
|
||||||
navigation.find('ul.menu').show();
|
navigation.find('ul.menu').removeClass('menu-close').show();
|
||||||
|
navigation.addClass('expanded');
|
||||||
$(this).addClass('expanded');
|
$(this).addClass('expanded');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//get click for item which has submenu
|
//get click for item which has submenu
|
||||||
navigation.on('click','.maintab.has_submenu a.title', function(e){
|
navigation.on('click.submenu','.maintab.has_submenu a.title', function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
navigation.find('.menu').hide();
|
navigation.find('.menu').addClass('menu-close');
|
||||||
$('#nav-mobile-submenu').remove();
|
$('#nav-mobile-submenu').remove();
|
||||||
//create submenu
|
//create submenu
|
||||||
submenu = $('<ul id="nav-mobile-submenu" class="menu"><li><a href="#" id="nav-mobile-submenu-back"><i class="icon-arrow-left"></i> Back</a></li></ul>');
|
submenu = $('<ul id="nav-mobile-submenu" class="menu"><li><a href="#" id="nav-mobile-submenu-back"><i class="icon-arrow-left"></i>'+ $(this).html() +'</a></li></ul>');
|
||||||
submenu.append($(this).closest('.maintab').find('.submenu').html());
|
submenu.append($(this).closest('.maintab').find('.submenu').html());
|
||||||
//show submenu
|
//show submenu
|
||||||
navigation.append(submenu);
|
navigation.append(submenu);
|
||||||
submenu.show();
|
submenu.show();
|
||||||
});
|
});
|
||||||
navigation.on('click','#nav-mobile-submenu-back',function(e){
|
navigation.on('click.back','#nav-mobile-submenu-back',function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
submenu.remove();
|
navigation.find('.menu').removeClass('menu-close').show(submenu.addClass('menu-close'));
|
||||||
navigation.find('.menu').show();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeMobileNav(){
|
||||||
|
navigation = $('#nav-mobile');
|
||||||
|
$('#nav-mobile-submenu').remove();
|
||||||
|
$('span.menu-collapse').html('<i class="icon-align-justify"></i>');
|
||||||
|
navigation.off();
|
||||||
|
if ($('body').hasClass('page-sidebar')){
|
||||||
|
navigation.attr('id',"nav-sidebar")
|
||||||
|
navSidebar();
|
||||||
|
} else if ($('body').hasClass('page-sidebar')){
|
||||||
|
navigation.attr('id',"nav-topbar")
|
||||||
|
navTopbar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//nav switch - not used for now
|
//nav switch - not used for now
|
||||||
function navSwitch(){
|
function navSwitch(){
|
||||||
if ($('body').hasClass('page-sidebar')||$('body').hasClass('page-sidebar-closed')){
|
if ($('body').hasClass('page-sidebar')){
|
||||||
navTopbar();
|
navTopbar();
|
||||||
} else {
|
} else {
|
||||||
navSidebar();
|
navSidebar();
|
||||||
@@ -148,13 +165,16 @@ $( document ).ready(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//init menu
|
//init menu
|
||||||
if ($('body').hasClass('page-sidebar')){
|
function initNav(){
|
||||||
navSidebar();
|
if ($('body').hasClass('page-sidebar')){
|
||||||
}
|
navSidebar();
|
||||||
else if ($('body').hasClass('page-topbar')) {
|
}
|
||||||
navTopbar();
|
else if ($('body').hasClass('page-topbar')) {
|
||||||
|
navTopbar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initNav();
|
||||||
//tooltip
|
//tooltip
|
||||||
$('.label-tooltip').tooltip();
|
$('.label-tooltip').tooltip();
|
||||||
|
|
||||||
@@ -192,7 +212,7 @@ $( document ).ready(function() {
|
|||||||
mobileNav();
|
mobileNav();
|
||||||
},
|
},
|
||||||
unmatch : function() {
|
unmatch : function() {
|
||||||
|
removeMobileNav();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -3,12 +3,16 @@
|
|||||||
@import "admin-theme/_bootstrap-variables"
|
@import "admin-theme/_bootstrap-variables"
|
||||||
@import "admin-theme/_bootstrap-init"
|
@import "admin-theme/_bootstrap-init"
|
||||||
@import "admin-theme/_font-awesome"
|
@import "admin-theme/_font-awesome"
|
||||||
|
@import "admin-theme/animate"
|
||||||
|
|
||||||
html, body
|
html, body
|
||||||
min-height: 100%
|
min-height: 100%
|
||||||
height: 100%
|
height: 100%
|
||||||
|
|
||||||
|
#header
|
||||||
|
z-index: 20
|
||||||
#main
|
#main
|
||||||
|
z-index: 10
|
||||||
float: left
|
float: left
|
||||||
width: 100%
|
width: 100%
|
||||||
min-height: 100%
|
min-height: 100%
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
#nav-mobile
|
#nav-mobile
|
||||||
position: absolute
|
position: fixed
|
||||||
top: 37px
|
top: 0
|
||||||
left: 0
|
left: 0
|
||||||
width: 50px
|
overflow: hidden
|
||||||
height: 50px
|
width: 100%
|
||||||
z-index: 500
|
height: 38px
|
||||||
|
z-index: 1100
|
||||||
|
&.expanded
|
||||||
|
height: 100%
|
||||||
li > a > i
|
li > a > i
|
||||||
display: inline-block
|
display: inline-block
|
||||||
height: 30px
|
height: 30px
|
||||||
@@ -15,25 +18,26 @@
|
|||||||
text-align: center
|
text-align: center
|
||||||
background: black
|
background: black
|
||||||
@include border-radius(40px)
|
@include border-radius(40px)
|
||||||
#nav-mobile-submenu
|
|
||||||
z-index: 700
|
|
||||||
ul.menu
|
ul.menu
|
||||||
z-index: 600
|
top: 37px
|
||||||
display: none
|
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 54px
|
display: none
|
||||||
background: $main-color
|
|
||||||
width: 480px
|
width: 480px
|
||||||
|
height: 100%
|
||||||
|
background-color: rgba(black,0.8)
|
||||||
margin: 0 0 100px 0
|
margin: 0 0 100px 0
|
||||||
padding: 0
|
padding: 0
|
||||||
border-top: 1px black solid
|
border-top: 1px black solid
|
||||||
list-style: none
|
list-style: none
|
||||||
|
@include transition(all 0.35s ease-out)
|
||||||
|
@include animate(fadeInLeft, 0.3s)
|
||||||
li
|
li
|
||||||
|
background: $main-color
|
||||||
position: relative
|
position: relative
|
||||||
a
|
a
|
||||||
display: block
|
display: block
|
||||||
position: relative
|
position: relative
|
||||||
padding: 2px 0 2px 20px
|
padding: 2px 0 2px 10px
|
||||||
border-bottom: 1px solid darken($main-color,10%)
|
border-bottom: 1px solid darken($main-color,10%)
|
||||||
font-size: 12px
|
font-size: 12px
|
||||||
line-height: 40px
|
line-height: 40px
|
||||||
@@ -59,9 +63,24 @@
|
|||||||
color: white
|
color: white
|
||||||
ul.submenu
|
ul.submenu
|
||||||
display: none
|
display: none
|
||||||
|
#nav-mobile-submenu
|
||||||
|
z-index: 1200
|
||||||
|
a:not(#nav-mobile-submenu-back)
|
||||||
|
font-size: 1.2em
|
||||||
|
padding-left: 50px
|
||||||
|
text-transform: none
|
||||||
a#nav-mobile-submenu-back
|
a#nav-mobile-submenu-back
|
||||||
background-color: darken($main-color,5%)
|
background-color: darken($main-color,5%)
|
||||||
|
font-size: 1.5em
|
||||||
|
ul.menu.menu-close
|
||||||
|
@include animate(fadeOutLeft, 0.2s)
|
||||||
|
.menu-collapse
|
||||||
|
position: absolute
|
||||||
|
width: 50px
|
||||||
|
height: 37px
|
||||||
|
line-height: 1.3em
|
||||||
|
top: 0
|
||||||
|
right: 0
|
||||||
|
|
||||||
#nav-sidebar
|
#nav-sidebar
|
||||||
position: fixed
|
position: fixed
|
||||||
@@ -285,6 +304,7 @@
|
|||||||
display: none
|
display: none
|
||||||
|
|
||||||
.menu-collapse
|
.menu-collapse
|
||||||
|
cursor: pointer
|
||||||
height: 54px
|
height: 54px
|
||||||
width: 100%
|
width: 100%
|
||||||
font-size: 2em
|
font-size: 2em
|
||||||
@@ -377,3 +397,4 @@
|
|||||||
|
|
||||||
[class^="icon-Admin"]
|
[class^="icon-Admin"]
|
||||||
margin-right: 6px
|
margin-right: 6px
|
||||||
|
|
||||||
+1719
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user