Просмотр исходного кода

add option to disable auto expand of navbar FR#150876

CauseFX 5 лет назад
Родитель
Сommit
a68759838e
3 измененных файлов с 26 добавлено и 2 удалено
  1. 8 1
      api/classes/organizr.class.php
  2. 2 1
      api/config/default.php
  3. 16 0
      js/functions.js

+ 8 - 1
api/classes/organizr.class.php

@@ -1394,6 +1394,12 @@ class Organizr
 					'label' => 'Auto-Collapse Categories',
 					'value' => $this->config['autoCollapseCategories']
 				),
+				array(
+					'type' => 'switch',
+					'name' => 'autoExpandNavBar',
+					'label' => 'Auto-Expand Nav Bar',
+					'value' => $this->config['autoExpandNavBar']
+				),
 				array(
 					'type' => 'select',
 					'name' => 'unsortedTabs',
@@ -3640,7 +3646,8 @@ class Organizr
 				'debugErrors' => $this->config['debugErrors'],
 				'sandbox' => $this->config['sandbox'],
 				'expandCategoriesByDefault' => $this->config['expandCategoriesByDefault'],
-				'autoCollapseCategories' => $this->config['autoCollapseCategories']
+				'autoCollapseCategories' => $this->config['autoCollapseCategories'],
+				'autoExpandNavBar' => $this->config['autoExpandNavBar']
 			),
 			'menuLink' => array(
 				'githubMenuLink' => $this->config['githubMenuLink'],

+ 2 - 1
api/config/default.php

@@ -484,5 +484,6 @@ return array(
 	'traktAccessToken' => '',
 	'traktAccessTokenExpires' => '',
 	'traktRefreshToken' => '',
-	'autoCollapseCategories' => false
+	'autoCollapseCategories' => false,
+	'autoExpandNavBar' => true
 );

+ 16 - 0
js/functions.js

@@ -4503,6 +4503,22 @@ function loadAppearance(appearance){
 			}
 		`;
 	}
+	if(activeInfo['settings']['misc']['autoExpandNavBar'] == false){
+		cssSettings += `
+			@media only screen and (min-width: 768px) {
+				.sidebar:hover .hide-menu {
+					display: none;
+				}
+				.sidebar:hover .sidebar-head,
+				.sidebar:hover {
+					width: 60px;
+				}
+				.sidebar:hover .nav-second-level li a {
+					padding-left: 15px;
+				}
+			}
+		`;
+	}
 	if(cssSettings !== ''){
 		$('#user-appearance').html(cssSettings);
 	}