mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
landing-pages: Add working "×" for mobile navigation.
This adds a working "×" icon that you can click to close the nav on the mobile product pages. Fixes #5260.
This commit is contained in:
committed by
Tim Abbott
parent
414df5ef8b
commit
244c4dc7fa
@@ -150,10 +150,8 @@ var events = function () {
|
|||||||
$("body").click(function (e) {
|
$("body").click(function (e) {
|
||||||
var $e = $(e.target);
|
var $e = $(e.target);
|
||||||
|
|
||||||
var should_close = !$e.is("ul, .hamburger") && $e.closest("ul, .hamburger").length === 0;
|
|
||||||
|
|
||||||
// this means that it is in mobile sidebar mode.
|
if ($e.is("nav ul .exit")) {
|
||||||
if ($("nav ul").height() === window.innerHeight && should_close) {
|
|
||||||
$("nav ul").removeClass("show");
|
$("nav ul").removeClass("show");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -165,6 +165,10 @@ nav ul {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nav ul .exit {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
nav ul li {
|
nav ul li {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -2030,6 +2034,17 @@ a:not(.no-style):hover:before {
|
|||||||
transform: translate(0px, 0px);
|
transform: translate(0px, 0px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nav ul .exit {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
right: 25px;
|
||||||
|
|
||||||
|
font-weight: 100;
|
||||||
|
font-size: 3em;
|
||||||
|
color: initial;
|
||||||
|
}
|
||||||
|
|
||||||
nav ul li:first-of-type {
|
nav ul li:first-of-type {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<span>Zulip</span>
|
<span>Zulip</span>
|
||||||
</a>
|
</a>
|
||||||
<ul>
|
<ul>
|
||||||
|
<div class="exit">×</div>
|
||||||
<li on-page="hello">
|
<li on-page="hello">
|
||||||
<a class="no-style" href="/hello/">Home</a>
|
<a class="no-style" href="/hello/">Home</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
<span>Zulip</span>
|
<span>Zulip</span>
|
||||||
</a>
|
</a>
|
||||||
<ul>
|
<ul>
|
||||||
|
<div class="exit">×</div>
|
||||||
<li on-page="hello">
|
<li on-page="hello">
|
||||||
<a class="no-style" href="/hello/">Home</a>
|
<a class="no-style" href="/hello/">Home</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user