Merge pull request #3608 from thelounge/richrd/channel-list-item-classes
Relocate not-secure and not-connected classes and make sure channel exists in jumpToChannel
This commit is contained in:
commit
f1eee6c9b2
@ -8,6 +8,11 @@
|
||||
{active: activeChannel && channel === activeChannel.channel},
|
||||
{'parted-channel': channel.type === 'channel' && channel.state === 0},
|
||||
{'has-draft': channel.pendingMessage},
|
||||
{
|
||||
'not-secure':
|
||||
channel.type === 'lobby' && network.status.connected && !network.status.secure,
|
||||
},
|
||||
{'not-connected': channel.type === 'lobby' && !network.status.connected},
|
||||
]"
|
||||
:aria-label="getAriaLabel()"
|
||||
:title="getAriaLabel()"
|
||||
|
@ -23,8 +23,6 @@
|
||||
:key="network.uuid"
|
||||
:class="{
|
||||
collapsed: network.isCollapsed,
|
||||
'not-connected': !network.status.connected,
|
||||
'not-secure': !network.status.secure,
|
||||
}"
|
||||
class="network"
|
||||
role="region"
|
||||
|
@ -729,22 +729,22 @@ background on hover (unless active) */
|
||||
margin: 0 8px;
|
||||
}
|
||||
|
||||
.network.not-secure .channel-list-item[data-type="lobby"] {
|
||||
.channel-list-item.not-secure {
|
||||
color: #f39c12;
|
||||
}
|
||||
|
||||
.network.not-secure .channel-list-item[data-type="lobby"]:hover,
|
||||
.network.not-secure .channel-list-item[data-type="lobby"].active {
|
||||
.channel-list-item.not-secure:hover,
|
||||
.channel-list-item.not-secure.active {
|
||||
color: #f8c572;
|
||||
}
|
||||
|
||||
.network.not-connected .channel-list-item[data-type="lobby"],
|
||||
.channel-list-item.not-connected,
|
||||
.channel-list-item.parted-channel {
|
||||
color: #e74c3c;
|
||||
}
|
||||
|
||||
.network.not-connected .channel-list-item[data-type="lobby"]:hover,
|
||||
.network.not-connected .channel-list-item[data-type="lobby"].active,
|
||||
.channel-list-item.not-connected:hover,
|
||||
.channel-list-item.not-connected.active,
|
||||
.channel-list-item.parted-channel:hover,
|
||||
.channel-list-item.parted-channel.active {
|
||||
color: #f1978e;
|
||||
|
@ -97,11 +97,13 @@ Mousetrap.bind(["alt+a"], function() {
|
||||
function jumpToChannel(targetChannel) {
|
||||
switchToChannel(targetChannel);
|
||||
|
||||
scrollIntoViewNicely(
|
||||
document.querySelector(
|
||||
`#sidebar .channel-list-item[aria-controls="#chan-${targetChannel.id}"]`
|
||||
)
|
||||
const element = document.querySelector(
|
||||
`#sidebar .channel-list-item[aria-controls="#chan-${targetChannel.id}"]`
|
||||
);
|
||||
|
||||
if (element) {
|
||||
scrollIntoViewNicely(element);
|
||||
}
|
||||
}
|
||||
|
||||
// Ignored keys which should not automatically focus the input bar
|
||||
|
Loading…
Reference in New Issue
Block a user