mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-08-12 17:23:38 +00:00
Merge pull request #42 from stagehacks/active-arrangement-indicator
Active arrangement indicator
This commit is contained in:
+14
-13
@@ -76,20 +76,21 @@ window.init = function init() {
|
||||
}
|
||||
};
|
||||
|
||||
document.getElementById('save-slot-1').onclick = function slot1click(e) {
|
||||
e.stopPropagation();
|
||||
SAVESLOTS.loadSlot(1);
|
||||
};
|
||||
const saveSlots = document.getElementsByClassName('save-slot');
|
||||
|
||||
document.getElementById('save-slot-2').onclick = function slot2click(e) {
|
||||
e.stopPropagation();
|
||||
SAVESLOTS.loadSlot(2);
|
||||
};
|
||||
|
||||
document.getElementById('save-slot-3').onclick = function slot3click(e) {
|
||||
e.stopPropagation();
|
||||
SAVESLOTS.loadSlot(3);
|
||||
};
|
||||
for (let i = 0; i < saveSlots.length; i++) {
|
||||
const saveSlot = saveSlots[i];
|
||||
saveSlot.addEventListener('click', (event) => {
|
||||
// get save slot from button id save-slot-1 = 1
|
||||
const saveSlotIndex = parseInt(
|
||||
event.target.id.replace('save-slot-', ''),
|
||||
10
|
||||
);
|
||||
if (saveSlotIndex) {
|
||||
SAVESLOTS.loadSlot(saveSlotIndex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('refresh-device-button').onclick =
|
||||
function refreshClick(e) {
|
||||
|
||||
+6
-4
@@ -56,6 +56,12 @@ a {
|
||||
-webkit-app-region: drag;
|
||||
z-index: 1000;
|
||||
}
|
||||
#view-buttons-bar .active {
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
color: white;
|
||||
border: #61c650;
|
||||
border-style: solid;
|
||||
}
|
||||
#view-buttons-bar button {
|
||||
background-color: rgba(255, 255, 255, 0.07);
|
||||
width: 26px;
|
||||
@@ -293,10 +299,6 @@ button:hover {
|
||||
button:focus {
|
||||
outline: none;
|
||||
}
|
||||
button.active {
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
color: white;
|
||||
}
|
||||
button:disabled {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
}
|
||||
|
||||
+7
-12
@@ -298,19 +298,14 @@ module.exports.getPinnedDevices = function getPinnedDevices() {
|
||||
};
|
||||
|
||||
module.exports.toggleSlotButtons = function toggleSlotButtons(slotIndex) {
|
||||
if (slotIndex === 1) {
|
||||
document.getElementById('save-slot-1').classList.add('active');
|
||||
document.getElementById('save-slot-2').classList.remove('active');
|
||||
document.getElementById('save-slot-3').classList.remove('active');
|
||||
} else if (slotIndex === 2) {
|
||||
document.getElementById('save-slot-1').classList.remove('active');
|
||||
document.getElementById('save-slot-2').classList.add('active');
|
||||
document.getElementById('save-slot-3').classList.remove('active');
|
||||
} else if (slotIndex === 3) {
|
||||
document.getElementById('save-slot-1').classList.remove('active');
|
||||
document.getElementById('save-slot-2').classList.remove('active');
|
||||
document.getElementById('save-slot-3').classList.add('active');
|
||||
// remove all currently active classes
|
||||
const currentActiveSlots = document.getElementsByClassName('active');
|
||||
for (let i = 0; i < currentActiveSlots.length; i++) {
|
||||
const slotButton = currentActiveSlots[i];
|
||||
slotButton.classList.remove('active');
|
||||
}
|
||||
// add the active class to the newly selected slot
|
||||
document.getElementById(`save-slot-${slotIndex}`).classList.add('active');
|
||||
};
|
||||
|
||||
module.exports.selectPreviousDevice = function selectPreviousDevice() {
|
||||
|
||||
Reference in New Issue
Block a user