Skip to content

Commit cd08e81

Browse files
committed
add mobile rules
1 parent 181adba commit cd08e81

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/assets/js/front-end.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,8 @@ var BoldGrid = BoldGrid || {};
681681
headerBottom = $headerContainer.offset().top + $headerContainer.outerHeight(),
682682
subMenuWidth = $subMenu.children( 'li' ).outerWidth(),
683683
subMenuHeight = $subMenu.outerHeight( true ) + pointerHeight,
684-
rightOffset = $( window ).outerWidth( true ) - ( leftOffset + subMenuWidth );
684+
rightOffset = $( window ).outerWidth( true ) - ( leftOffset + subMenuWidth ),
685+
screenWidth = $( window ).width() + 16;
685686

686687
// Adjust the offset for menu items in the footer so it opens upwards instead of down.
687688
if ( bottomOffset > headerBottom && $subMenu.closest( '#colophon' ).length ) {
@@ -693,6 +694,11 @@ var BoldGrid = BoldGrid || {};
693694
}
694695

695696
// Adjust left or right offset if submenu goes off screen.
697+
if ( 992 >= screenWidth ) {
698+
$subMenu.css( 'left', 0 );
699+
return;
700+
}
701+
696702
if ( 0 > rightOffset ) {
697703
$subMenu.css( 'left', rightOffset );
698704
}

0 commit comments

Comments
 (0)