From cabcdbdb663944255a752dffd1c364d9fe414e4e Mon Sep 17 00:00:00 2001 From: MinSoo Kim Date: Mon, 5 Sep 2016 17:22:32 +0900 Subject: [PATCH] Fix mobile member menu width --- layouts/simple_world/layout.js | 9 ++++++++- layouts/simple_world/layout.scss | 10 +++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/layouts/simple_world/layout.js b/layouts/simple_world/layout.js index 282a2929a..eead87d60 100644 --- a/layouts/simple_world/layout.js +++ b/layouts/simple_world/layout.js @@ -1,5 +1,12 @@ $(function() { - $('.layout_menu>ul>li:first-child .layout_dropdown-content, .layout_menu>ul>li:first-child .layout_dropdown-content a').css('width', $('.layout_menu>ul>li:first-child').width()).css('min-width', $('.layout_menu>ul>li:first-child').width()); + if($('.layout_menu>ul>li:first-child').width() > 50) { + $('.layout_menu>ul>li:first-child .layout_dropdown-content, .layout_menu>ul>li:first-child .layout_dropdown-content a').css('width', $('.layout_menu>ul>li:first-child').width()).css('min-width', $('.layout_menu>ul>li:first-child').width()); + } +$( window ).resize(function() { + if($('.layout_menu>ul>li:first-child').width() > 50) { + $('.layout_menu>ul>li:first-child .layout_dropdown-content, .layout_menu>ul>li:first-child .layout_dropdown-content a').css('width', $('.layout_menu>ul>li:first-child').width()).css('min-width', $('.layout_menu>ul>li:first-child').width()); + } +}); "use strict"; diff --git a/layouts/simple_world/layout.scss b/layouts/simple_world/layout.scss index e38b435fe..d71c81bd6 100644 --- a/layouts/simple_world/layout.scss +++ b/layouts/simple_world/layout.scss @@ -208,6 +208,7 @@ body { .layout_menu>ul>li:first-child { float: right; + } .layout_menu li a, .dropbtn { @@ -216,10 +217,8 @@ body { text-align: center; padding: 14px 16px; text-decoration: none; -} - -.layout_menu>ul>li:first-child { - float: right; + font-size: 13px; + line-height: 1; } .layout_menu li.active>a { @@ -238,7 +237,7 @@ body { } .layout_menu li.layout_dropdown { - display: inline-block; + display: block; } .layout_menu .layout_dropdown-content { @@ -448,6 +447,7 @@ body { position: relative; background-color: lighten($grey, 35%); color: layoutGrayContrast(lighten($grey, 35%), 0.710); + width: 100%; min-width: 100%; box-shadow: none; }