mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-07-26 09:18:39 +00:00
clean up active device selection
when clicking first column
This commit is contained in:
+2
-16
@@ -91,6 +91,8 @@ window.init = function init() {
|
||||
const deviceID = e.srcElement.id;
|
||||
if (e.srcElement.id !== 'device-list') {
|
||||
VIEW.switchDevice(deviceID);
|
||||
} else {
|
||||
VIEW.switchDevice(undefined);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -125,22 +127,6 @@ window.init = function init() {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
document.getElementById('device-list-col').onclick = function deviceListClick(e) {
|
||||
try {
|
||||
document.querySelector('#device-list .active-device').classList.remove('active-device');
|
||||
ipcRenderer.send('disableDeviceDropdown', '');
|
||||
} catch (err) {
|
||||
// console.log(err)
|
||||
}
|
||||
try {
|
||||
document.getElementsByClassName('active-device-outline')[0].classList.remove('active-device-outline');
|
||||
} catch (err) {
|
||||
// console.log(err)
|
||||
}
|
||||
|
||||
VIEW.switchDevice();
|
||||
};
|
||||
};
|
||||
|
||||
ipcRenderer.on('setActiveDevicePinned', (event, message) => {
|
||||
|
||||
@@ -343,7 +343,6 @@ function heartbeat() {
|
||||
d.sendQueue.shift();
|
||||
}
|
||||
});
|
||||
document.getElementById('network-indicator-dot').style.background = '#111';
|
||||
}
|
||||
setInterval(heartbeat, 50);
|
||||
|
||||
|
||||
@@ -162,6 +162,10 @@ function switchDevice(id) {
|
||||
if (id === undefined) {
|
||||
document.getElementById('refresh-device-button').disabled = true;
|
||||
document.getElementById('device-settings-table').style.display = 'none';
|
||||
const $activeDevice = document.querySelector('.active-device');
|
||||
if ($activeDevice) {
|
||||
$activeDevice.classList.remove('active-device');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user