diff --git a/endpoints/settings/mobile_navigation.php b/endpoints/settings/mobile_navigation.php new file mode 100644 index 000000000..4d9ee7580 --- /dev/null +++ b/endpoints/settings/mobile_navigation.php @@ -0,0 +1,36 @@ + false, + "message" => translate('session_expired', $i18n) + ])); +} + +if ($_SERVER["REQUEST_METHOD"] === "POST") { + $postData = file_get_contents("php://input"); + $data = json_decode($postData, true); + + $mobile_nav = $data['value']; + + $stmt = $db->prepare('UPDATE settings SET mobile_nav = :mobile_nav WHERE user_id = :userId'); + $stmt->bindParam(':mobile_nav', $mobile_nav, SQLITE3_INTEGER); + $stmt->bindParam(':userId', $userId, SQLITE3_INTEGER); + + if ($stmt->execute()) { + die(json_encode([ + "success" => true, + "message" => translate("success", $i18n) + ])); + } else { + die(json_encode([ + "success" => false, + "message" => translate("error", $i18n) + ])); + } +} +« + +?> \ No newline at end of file diff --git a/includes/header.php b/includes/header.php index dd5592e10..239af3999 100644 --- a/includes/header.php +++ b/includes/header.php @@ -65,6 +65,8 @@ function hex2rgb($hex) return "$r, $g, $b"; } +$mobileNavigation = $settings['mobile_nav'] ? "mobile-navivagtion" : ""; + ?> @@ -139,7 +141,7 @@ function hex2rgb($hex) - +

diff --git a/styles/styles.css b/styles/styles.css index f2f7489fe..8c8a453e5 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -123,9 +123,14 @@ header .logo .logo-image svg { display: inline-block; } -@media (min-width: 768px) { - .dropbtn:after { - content: " ▼"; +.dropbtn:after { + content: " ▼"; +} + +@media (max-width: 768px) { + .mobile-navivagtion .dropbtn:after { + content: ""; + display: none; } } @@ -2610,10 +2615,8 @@ input[type="radio"]:checked+label::after { .mobile-nav>button>i { color: #fff; } -} -@media (max-width: 768px) { - .hideOnMobile { + .mobile-navivagtion .mobileNavigationHideOnMobile { display: none !important; } } \ No newline at end of file