SHA256
Связи: перенести переключатель версии в шапку
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
client.version=1.19.34
|
client.version=1.19.35
|
||||||
server.version=1.15.0
|
server.version=1.15.0
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ function saveMode(mode) {
|
|||||||
|
|
||||||
function createModeSwitcher(mode, navigate) {
|
function createModeSwitcher(mode, navigate) {
|
||||||
const label = document.createElement('label');
|
const label = document.createElement('label');
|
||||||
label.className = 'network-version-switcher';
|
label.className = 'network-version-switcher network-version-switcher--topbar';
|
||||||
label.innerHTML = '<span>Версия связей</span>';
|
label.innerHTML = '<span>Версия:</span>';
|
||||||
|
|
||||||
const select = document.createElement('select');
|
const select = document.createElement('select');
|
||||||
select.setAttribute('aria-label', 'Версия экрана Связи');
|
select.setAttribute('aria-label', 'Версия экрана Связи');
|
||||||
select.innerHTML = `
|
select.innerHTML = `
|
||||||
<option value="legacy">Прежняя</option>
|
<option value="legacy">Версия 1</option>
|
||||||
<option value="modern">Новая</option>
|
<option value="modern">Версия 2</option>
|
||||||
`;
|
`;
|
||||||
select.value = mode;
|
select.value = mode;
|
||||||
select.addEventListener('change', () => {
|
select.addEventListener('change', () => {
|
||||||
@@ -49,6 +49,9 @@ export function render(context = {}) {
|
|||||||
const implementation = mode === 'legacy' ? legacyNetworkView : modernNetworkView;
|
const implementation = mode === 'legacy' ? legacyNetworkView : modernNetworkView;
|
||||||
const screen = implementation.render(context);
|
const screen = implementation.render(context);
|
||||||
screen.classList.add(`network-screen--${mode}`);
|
screen.classList.add(`network-screen--${mode}`);
|
||||||
screen.prepend(createModeSwitcher(mode, context.navigate));
|
const switcher = createModeSwitcher(mode, context.navigate);
|
||||||
|
const topbarLeft = document.querySelector('#topbar-slot .topbar__left');
|
||||||
|
if (topbarLeft) topbarLeft.append(switcher);
|
||||||
|
else screen.prepend(switcher);
|
||||||
return screen;
|
return screen;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,30 +12,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.network-version-switcher {
|
.network-version-switcher {
|
||||||
position: absolute;
|
|
||||||
top: calc(var(--topbar-height, 64px) + 8px);
|
|
||||||
right: var(--page-gutter);
|
|
||||||
z-index: 24;
|
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
padding: 5px 8px;
|
|
||||||
border: 1px solid color-mix(in srgb, var(--border-control) 82%, transparent);
|
|
||||||
border-radius: 10px;
|
|
||||||
background: color-mix(in srgb, var(--surface) 92%, transparent);
|
|
||||||
box-shadow: 0 4px 16px color-mix(in srgb, #000 20%, transparent);
|
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
-webkit-backdrop-filter: blur(10px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.network-version-switcher select {
|
.network-version-switcher select {
|
||||||
max-width: 92px;
|
max-width: 98px;
|
||||||
border: 0;
|
padding: 3px 4px;
|
||||||
outline: 0;
|
border: 1px solid var(--border-control);
|
||||||
background: transparent;
|
border-radius: 7px;
|
||||||
|
background: var(--surface);
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
font: inherit;
|
font: inherit;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
|||||||
Reference in New Issue
Block a user