Skip to content

Commit

Permalink
let mobile menu do child items
Browse files Browse the repository at this point in the history
at least one level
  • Loading branch information
Bearded Avenger committed Aug 5, 2013
1 parent 863c41c commit b029de9
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 51 deletions.
64 changes: 32 additions & 32 deletions editor/mobile.menu.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php
<?php



class PageLinesMobileMenu {



function __construct(){

add_action('pagelines_before_site', array(&$this, 'menu_template'));

}

function menu_template(){

$menu = ( pl_setting( 'primary_navigation_menu' ) ) ? pl_setting( 'primary_navigation_menu' ) : false;
$menu2 = ( pl_setting( 'secondary_navigation_menu' ) ) ? pl_setting( 'secondary_navigation_menu' ) : false;
?>
Expand All @@ -23,61 +23,61 @@ function menu_template(){
<i class="icon-remove icon-large"></i>
</div>
<?php

if ( is_array( wp_get_nav_menu_items( $menu ) ) || has_nav_menu( 'primary' ) ) {

wp_nav_menu(
array(
'menu_class' => 'mobile-menu primary-menu',
'menu' => $menu,
'container' => null,
'container_class' => '',
'depth' => 1,
'depth' => 2,
'fallback_cb' => ''
)
);

} else
pl_nav_fallback( 'mobile-menu primary-menu' );

if ( is_array( wp_get_nav_menu_items( $menu2 ) ) ) {

wp_nav_menu(
array(
'menu_class' => 'mobile-menu secondary-menu',
'menu' => $menu2,
'container' => null,
'container_class' => '',
'depth' => 1,
'depth' => 2,
'fallback_cb' => ''
)
);
}
$twitter = pl_setting('twittername');

}


$twitter = pl_setting('twittername');
$facebook = pl_setting('facebook_name');

?>
<div class="social-menu">
<?php

<?php

if($facebook)
printf('<a href="http://www.facebook.com/%s"><i class="mm-icon icon-large icon-facebook"></i></a>', $facebook);

if($twitter)
printf('<a href="http://www.twitter.com/%s"><i class="mm-icon icon-large icon-twitter"></i></a>', $twitter);
printf('<a href="http://www.twitter.com/%s"><i class="mm-icon icon-large icon-twitter"></i></a>', $twitter);

printf('<a href="%s"><i class="mm-icon icon-large icon-rss"></i></a></li>', get_bloginfo( 'rss2_url' ) );?>
</div>
</div>
</div>
<?php
<?php

}



}
138 changes: 119 additions & 19 deletions less/pl-structure.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,104 @@ body {
.site-wrap{
background: @bodyBackground;
z-index: 0;
position: relative;
.transition(all .3s ease-in-out);

&.show-mm {
.translate3d(-260px, 0, 0);
}

}
.pl-mobile-menu{
position: absolute;
display: none;
width: 260px;
right: 0;
top: 0;
background:#0c0c0c;
height: 100%;
color: rgba(255,255,255,.5);

ul.mobile-menu{
margin-bottom: 25px;
}
a{
color:inherit;
&:hover{
color: #fff;
}
}
ul.primary-menu{
li{
margin-bottom: 5px;
}
a{
font-size: @fontSizeLarge;
line-height: 1.4em;
}
// Submenus
.sub-menu {
padding:4px 0 0 8px;
.box-sizing(border-box);
li {
a {
color:inherit;
font-size: @fontSizeLarge - 3;
}

&.current_page_item a {
color: @white;
}
}
}
}
ul li {

&.current_page_item a{
color: #fff;
}
}
.mm-holder{
padding: 20px 30px;
}
.mm-close{
float: right;
cursor: pointer;
opacity: .5;
&:hover, &:active{
opacity: 1;
}
}
.mm-icon{
margin-right: 10px;
}
}



&.display-boxed .boxed-wrap{
position: relative;
margin: 0 auto;
max-width: @plContentWidth + 20;
background: @pl-base;
&.boxed-nobg{background: transparent;}
.pl-area-wrap > .pl-content {
padding-left: 12px;
padding-right: 12px;
}
}
&.display-full .pl-content{
position: relative;
max-width: @plContentWidth;
margin: 0 auto;

}
.section-plcolumn{
margin-bottom: 0;
}

#footer section:last-child{
margin-bottom: 0;
}
}


Expand Down Expand Up @@ -48,12 +143,14 @@ body .pl-area .pl-section{
}

.pl-area-wrap{
.background-size(cover);
background-position: 50% 0;
}

.pl-parallax{

.pl-bg-cover{
.background-size(cover);
}
.pl-bg-repeat{
background-repeat: repeat;
}


Expand All @@ -73,44 +170,47 @@ body .pl-area .pl-section{

.pl-black,
.pl-grey{
color: rgba(255,255,255,.7);
color: rgba(255,255,255,.7);
h1, h2, h3, h4, h5, h6, a{
color:#fff;
color:#fff;
}
a:hover{
opacity: .7;
color:inherit;
}
}
.pl-black{
background:#000;
background:#000;
.pl-contrast{
background: #222;
background: #222;
}
}

.pl-grey{
background:#1c1c1c;
background:#1c1c1c;
.pl-contrast{
background: #000;
background: #000;
}
}

.pl-dark-img{
background:#000;
color: #fff;
background:#000;
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,.8);
.pl-contrast{
background: rgba(0,0,0,.2);
background: rgba(0,0,0,.2);
}
a{
color: #fff;
}
}

.pl-light-img{
background:#fff;
color: #000;
background:#fff;
color: #000;
text-shadow: 0 1px 0 rgba(255,255,255,.8);
.pl-contrast{
background: rgba(255,255,255,.2);
background: rgba(255,255,255,.2);
}
}

Expand Down Expand Up @@ -171,15 +271,15 @@ body{
****************************************/
@media screen and ( max-width:@resPortraitTablet ){

.responsive{

.site-wrap{
-webkit-backface-visibility: hidden; // fixes flicker
}

}

/*
* RESPONSIVE: PHONE
****************************************/\
****************************************/
@media screen and ( max-width : @resPhoneLandscape ) {

.responsive{
Expand Down

0 comments on commit b029de9

Please sign in to comment.