Merge pull request 'feat: add search toggle option (fix #509)' (#515) from feature/issue509-search-toggle into develop
Reviewed-on: https://gitnet.fr/deblan/side_menu/pulls/515
This commit is contained in:
@@ -97,6 +97,7 @@ class AdminSettingController extends Controller
|
||||
'use-avatar',
|
||||
'add-logo-link',
|
||||
'show-settings',
|
||||
'show-search-form',
|
||||
'loader-enabled',
|
||||
'always-displayed',
|
||||
'enabled',
|
||||
@@ -137,6 +138,7 @@ class AdminSettingController extends Controller
|
||||
'use-avatar' => '0',
|
||||
'add-logo-link' => '1',
|
||||
'show-settings' => '0',
|
||||
'show-search-form' => '1',
|
||||
'loader-enabled' => '1',
|
||||
'always-displayed' => '0',
|
||||
'enabled' => '1',
|
||||
@@ -206,7 +208,17 @@ class AdminSettingController extends Controller
|
||||
}
|
||||
|
||||
foreach ($defaults as $key => $default) {
|
||||
if (!array_key_exists($key, $config)) {
|
||||
if (array_key_exists($key, $config)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (in_array($key, $booleans)) {
|
||||
$config[$key] = $default === '1';
|
||||
} elseif (in_array($key, $arrays)) {
|
||||
$config[$key] = json_decode($default);
|
||||
} elseif (in_array($key, $integers)) {
|
||||
$config[$key] = (int) $default;
|
||||
} else {
|
||||
$config[$key] = $default;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +135,7 @@ class JsController extends Controller
|
||||
'force-light-icon' => $this->config->getAppValueBool('force-light-icon', '0'),
|
||||
'display-logo' => $this->config->getAppValueBool('display-logo', '1'),
|
||||
'use-avatar' => $this->config->getAppValueBool('use-avatar', '0'),
|
||||
'show-search-form' => $this->config->getAppValueBool('show-search-form', '1'),
|
||||
'hide-when-no-apps' => $this->config->getAppValueBool('hide-when-no-apps', '0'),
|
||||
'loader-enabled' => $this->config->getAppValueBool('loader-enabled', '1'),
|
||||
'always-displayed' => $this->config->getAppValueBool('always-displayed', '0'),
|
||||
|
||||
@@ -109,3 +109,4 @@
|
||||
'Customize': 'Přizpůsobit'
|
||||
'Custom': 'Custom'
|
||||
'Close': 'Zavřít'
|
||||
'Show the search form': 'Show the search form'
|
||||
|
||||
@@ -109,3 +109,4 @@
|
||||
'Customize': 'Customize'
|
||||
'Custom': 'Custom'
|
||||
'Close': 'Close'
|
||||
'Show the search form': 'Show the search form'
|
||||
|
||||
@@ -109,3 +109,4 @@
|
||||
'Customize': 'Personalizar'
|
||||
'Custom': 'Custom'
|
||||
'Close': 'Cerrar'
|
||||
'Show the search form': 'Show the search form'
|
||||
|
||||
@@ -128,3 +128,4 @@
|
||||
'Customize': 'Personnaliser'
|
||||
'Custom': 'Personnalisé'
|
||||
'Close': 'Fermer'
|
||||
'Show the search form': 'Afficher le formulaire de recherche'
|
||||
|
||||
@@ -109,3 +109,4 @@
|
||||
'Customize': 'Personalizar'
|
||||
'Custom': 'Personalizado'
|
||||
'Close': 'Pechar'
|
||||
'Show the search form': 'Show the search form'
|
||||
|
||||
@@ -109,3 +109,4 @@
|
||||
'Customize': 'Customize'
|
||||
'Custom': 'Custom'
|
||||
'Close': 'Close'
|
||||
'Show the search form': 'Show the search form'
|
||||
|
||||
@@ -107,3 +107,4 @@
|
||||
'Customize': 'Customize'
|
||||
'Custom': 'Custom'
|
||||
'Close': 'Close'
|
||||
'Show the search form': 'Show the search form'
|
||||
|
||||
@@ -109,3 +109,4 @@
|
||||
'Customize': 'Приспособить'
|
||||
'Custom': 'Custom'
|
||||
'Close': 'Закрыть'
|
||||
'Show the search form': 'Show the search form'
|
||||
|
||||
@@ -107,3 +107,4 @@
|
||||
'Customize': 'Customize'
|
||||
'Custom': 'Custom'
|
||||
'Close': 'Close'
|
||||
'Show the search form': 'Show the search form'
|
||||
|
||||
@@ -109,3 +109,4 @@
|
||||
'Customize': 'Anpassa'
|
||||
'Custom': 'Anpassad'
|
||||
'Close': 'Stäng'
|
||||
'Show the search form': 'Show the search form'
|
||||
|
||||
@@ -109,3 +109,4 @@
|
||||
'Customize': 'Customize'
|
||||
'Custom': 'Custom'
|
||||
'Close': 'Close'
|
||||
'Show the search form': 'Show the search form'
|
||||
|
||||
@@ -109,3 +109,4 @@
|
||||
'Customize': '自定义'
|
||||
'Custom': '自定义'
|
||||
'Close': '关闭'
|
||||
'Show the search form': 'Show the search form'
|
||||
|
||||
@@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
:label="settings.name"
|
||||
:avatar="settings.avatar"
|
||||
/>
|
||||
<AppSearch v-model="search" />
|
||||
<AppSearch v-if="showSearchForm" v-model="search" />
|
||||
<OpenerButton
|
||||
v-if="!openerHover"
|
||||
@click="$emit('close')"
|
||||
@@ -102,6 +102,7 @@ const activeApp = ref(null)
|
||||
const targetBlankApps = ref([])
|
||||
const settings = ref(null)
|
||||
const search = ref('')
|
||||
const showSearchForm = ref(true)
|
||||
const openerHover = ref(false)
|
||||
const menu = useTemplateRef('menu')
|
||||
const isTouchDevice = window.matchMedia('(pointer: coarse)').matches
|
||||
@@ -120,6 +121,7 @@ onMounted(async () => {
|
||||
|
||||
targetBlankApps.value = config['target-blank-apps']
|
||||
settings.value = config['settings']
|
||||
showSearchForm.value = config['show-search-form']
|
||||
openerHover.value = config['opener-hover'] && !isTouchDevice
|
||||
|
||||
items.value = await navStore.getCategories()
|
||||
|
||||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
:avatar="settings.avatar"
|
||||
/>
|
||||
<AppSearch
|
||||
v-if="open"
|
||||
v-if="showSearchForm"
|
||||
v-model="search"
|
||||
/>
|
||||
<OpenerButton
|
||||
@@ -103,6 +103,7 @@ const openerHover = ref(false)
|
||||
const alwaysDisplayed = ref(false)
|
||||
const displayLogo = ref(false)
|
||||
const useAvatarAsLogo = ref(false)
|
||||
const showSearchForm = ref(true)
|
||||
const search = ref('')
|
||||
const apps = ref([])
|
||||
const menu = useTemplateRef('menu')
|
||||
@@ -151,6 +152,7 @@ onMounted(async () => {
|
||||
alwaysDisplayed.value = config['always-displayed']
|
||||
targetBlankApps.value = config['target-blank-apps']
|
||||
forceLightIcon.value = config['force-light-icon']
|
||||
showSearchForm.value = config['show-search-form']
|
||||
|
||||
avatar.value = config['avatar']
|
||||
logo.value = config['logo']
|
||||
|
||||
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
:label="settings.name"
|
||||
:avatar="settings.avatar"
|
||||
/>
|
||||
<AppSearch v-model="search" />
|
||||
<AppSearch v-if="showSearchForm" v-model="search" />
|
||||
<OpenerButton
|
||||
v-if="!openerHover"
|
||||
@click="$emit('close')"
|
||||
@@ -107,6 +107,7 @@ const activeApp = ref(null)
|
||||
const targetBlankApps = ref([])
|
||||
const settings = ref(null)
|
||||
const search = ref('')
|
||||
const showSearchForm = ref(true)
|
||||
const openerHover = ref(false)
|
||||
const menu = useTemplateRef('menu')
|
||||
const isTouchDevice = window.matchMedia('(pointer: coarse)').matches
|
||||
@@ -125,6 +126,7 @@ onMounted(async () => {
|
||||
|
||||
targetBlankApps.value = config['target-blank-apps']
|
||||
settings.value = config['settings']
|
||||
showSearchForm.value = config['show-search-form']
|
||||
openerHover.value = config['opener-hover'] && !isTouchDevice
|
||||
|
||||
items.value = await navStore.getCategories()
|
||||
|
||||
@@ -80,6 +80,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<FormYesNo v-model="config['show-settings']" />
|
||||
</SettingValue>
|
||||
</SettingItem>
|
||||
<SettingItem :disabled="config['always-displayed']">
|
||||
<SettingLabel
|
||||
label="Show the search form"
|
||||
:middle="true"
|
||||
/>
|
||||
<SettingValue>
|
||||
<FormYesNo v-model="config['show-search-form']" />
|
||||
</SettingValue>
|
||||
</SettingItem>
|
||||
<SettingItem>
|
||||
<SettingLabel
|
||||
label="Icons"
|
||||
|
||||
Reference in New Issue
Block a user