Fixed an issue where lock layout menu was not in sync with preferences. #5758

This commit is contained in:
Pravesh Sharma
2023-02-10 10:31:02 +05:30
committed by GitHub
parent 713ddb5f62
commit ff6f0825b8
3 changed files with 18 additions and 2 deletions

View File

@@ -565,6 +565,8 @@ def utils():
# This will be opposite of use_space option
editor_indent_with_tabs = False if editor_use_spaces else True
prefs = Preferences.module('browser')
current_ui_lock = prefs.preference('lock_layout').get()
# Try to fetch current libpq version from the driver
try:
from config import PG_DEFAULT_DRIVER
@@ -627,7 +629,8 @@ def utils():
username=current_user.username,
auth_source=auth_source,
heartbeat_timeout=config.SERVER_HEARTBEAT_TIMEOUT,
password_length_min=config.PASSWORD_LENGTH_MIN
password_length_min=config.PASSWORD_LENGTH_MIN,
current_ui_lock=current_ui_lock
),
200, {'Content-Type': MIMETYPE_APP_JS})

View File

@@ -20,7 +20,7 @@
{% endif %}label: "{{ item.label }}", applies: ["{{ key.lower() }}"],
priority: {{ item.priority }},
enable: "{{ item.enable }}",
{% if item.checked is defined %}checked: {% if item.checked %}true{% else %}false{% endif %},
{% if item.checked is defined %}checked: {% if (item.checked || item.name == 'mnu_lock_'+current_ui_lock) %}true{% else %}false{% endif %},
{% endif %}
{% if item.below is defined %}below: {% if item.below %}true{% else %}false{% endif %},
{% endif %}